Responsive

Layout & Structure
stable

Aspect-ratio container that constrains its content to a fixed ratio using a sizer trick. Supports dimension overrides and standard spacing props.

Aperçu

Rendu de l’aperçu en cours…

16/9

Rendu de l’aperçu en cours…

4/3

Rendu de l’aperçu en cours…

1/1

Structure

Anatomie

Décomposition visuelle de la structure interne du composant avec les appels de classes BEM.

Anatomy of OrigamResponsiveSchematic of the Responsive component with 3 numbered internal parts. __sizer (padding-block-end drives ratio) #default slot content 1 2 3
Anatomy of <origam-responsive> — 3 parts: root container ①, sizer div ② (drives padding-block-end aspect trick), and content div ③.
1.origam-responsive
Root element. Flex container, overflow hidden. Receives dimension, padding, margin, border and rounded classes.
2.origam-responsive__sizer
Zero-height helper div. Its padding-block-end (set via useAspectRatio) forces the container to the correct ratio height.
3.origam-responsive__content
Absolutely positioned content area filling the ratio-locked space. Receives contentClass.

API

Props

Toutes les props acceptées par ce composant, avec leur type, valeur par défaut et description.

aspectRatio
string | number
Desired aspect ratio expressed as 'width/height' string (e.g. '16/9') or a decimal number. When set, drives the padding-block-end sizer trick.
contentClass
string
Additional CSS class applied to the inner .origam-responsive__content div.
inline
boolean
false
Switches the root from display:block to display:inline-flex, making the container flow inline with text.
height
number | string
Explicit height override. Accepts a CSS length or a number (converted to px).
maxHeight
number | string
Maximum height. Useful to cap a 16/9 container at a given viewport height.
maxWidth
number | string
Maximum width.
minHeight
number | string
Minimum height.
minWidth
number | string
Minimum width.
width
number | string
Explicit width override.
id
string
class
string | Array<string> | object
style
string | Array<string> | object | StyleValue
tag
string
padding
boolean | number | string
Shorthand CSS padding applied to the root container.
paddingTop
boolean | number | string
paddingLeft
boolean | number | string
paddingBottom
boolean | number | string
paddingRight
boolean | number | string
paddingBlock
boolean | number | string
paddingInline
boolean | number | string
paddingInlineStart
boolean | number | string
paddingInlineEnd
boolean | number | string
paddingBlockStart
boolean | number | string
paddingBlockEnd
boolean | number | string
margin
boolean | number | string
Shorthand CSS margin applied to the root container.
marginTop
boolean | number | string
marginLeft
boolean | number | string
marginBottom
boolean | number | string
marginRight
boolean | number | string
marginBlock
boolean | number | string
marginInline
boolean | number | string
marginInlineStart
boolean | number | string
marginInlineEnd
boolean | number | string
marginBlockStart
boolean | number | string
marginBlockEnd
boolean | number | string
border
boolean | number | string | TDirectionBoth | Array<TDirectionBoth>
false
Applies a border to the responsive container.
borderTop
boolean | number | string
borderLeft
boolean | number | string
borderBottom
boolean | number | string
borderRight
boolean | number | string
borderBlock
boolean | number | string
borderInline
boolean | number | string
borderInlineStart
boolean | number | string
borderInlineEnd
boolean | number | string
borderBlockStart
boolean | number | string
borderBlockEnd
boolean | number | string
borderColor
string
borderStyle
string
borderTopColor
TColor
borderRightColor
TColor
borderBottomColor
TColor
borderLeftColor
TColor
borderInlineStartColor
TColor
borderInlineEndColor
TColor
borderBlockStartColor
TColor
borderBlockEndColor
TColor
Border-radius applied to the container (clips overflow of the content).
roundedTopRight
boolean | number | string
roundedTopLeft
boolean | number | string
roundedBottomLeft
boolean | number | string
roundedBottomRight
boolean | number | string
roundedStartStart
boolean | number | string
roundedStartEnd
boolean | number | string
roundedEndStart
boolean | number | string
roundedEndEnd
boolean | number | string

API

Slots

Emplacements de contenu exposés par ce composant.

#additional
Extra content placed between the sizer and the main content div. Useful for overlays or decorative layers.
#default
Content placed inside .origam-responsive__content, absolutely positioned to fill the ratio-locked area.

API

Membres exposés

Propriétés et méthodes accessibles via ref template (defineExpose). Utilisés pour le contrôle programmatique.

<T extends object>(props: T, exclude?: string[]) => Partial<T>
Utility to forward a filtered subset of props to child components.
Ref<string>
Reactive CSS string generated by useStyle.
string
Unique style-sheet ID for this instance.
() => void
Injects the computed style sheet. Called automatically on mount.
() => void
Removes the injected style sheet. Called automatically on unmount.
Ref<boolean>
True once the style sheet has been injected.

Personnalisation

Variables CSS

Propriétés CSS personnalisées exposées par ce composant. Surchargez-les pour personnaliser sans perdre la compatibilité avec le thème.

Default aspect ratio when no aspectRatio prop is set.
Overflow applied to the root container. Hidden by default to clip content.
Default max-width of the responsive container.

Inclusion

Accessibilité

Rôles ARIA, navigation clavier et gestion du focus. Sourcé depuis le template réel du composant.

Notes

  • OrigamResponsive is a pure layout container with no interactive role. Accessibility is owned by the content placed in the default slot.
  • When wrapping an iframe or img, ensure the embedded element has appropriate title or alt attributes for screen readers.

Fondation

Design tokens

Extrait des tokens de ce composant — les variables --origam-<composant>---<propriété>, déclarées dans sa feuille de tokens tenue à la main, sans étape de build.

Source
other
1.7778
Default aspect ratio applied when no prop is set.
other
100%
Default max-width of the container.
other
hidden
Overflow mode — hidden clips content to the ratio box.

Interactif

Playground

Modifiez les props en direct et observez le composant se mettre à jour. Le snippet de code généré suit vos changements.

Rendu de l’aperçu en cours…

Usage

Exemples

Extraits de code prêts à coller dans vos templates.

16/9 video embed

vue

Responsive image

vue

Inline mode

vue