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.

Preview

Rendering the live preview…

16/9

Rendering the live preview…

4/3

Rendering the live preview…

1/1

Structure

Anatomy

Visual breakdown of the component's internal structure with BEM class call-outs.

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

All props accepted by this component, with their type, default value and 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

Content slots exposed by this component.

#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

Exposed members

Properties and methods accessible via template ref (defineExpose). Use them for programmatic control.

<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.

Customisation

CSS variables

CSS custom properties exposed by this component. Override them to customise the component without losing theme compatibility.

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

Accessibility

ARIA roles, keyboard navigation and focus management. Sourced from the real component template.

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.

Foundation

Design tokens

Excerpt from this component's token declarations — the --origam-<component>---<property> variables, declared in its hand-maintained token sheet with no build step.

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.

Interactive

Playground

Edit props live and see the component update in real time. The generated code snippet updates as you change values.

Rendering the live preview…

Usage

Examples

Ready-to-paste code snippets for your templates.

16/9 video embed

vue

Responsive image

vue

Inline mode

vue