Layout
Root layout container that coordinates space-reservation for registered layout items (Drawer, AppBar, BottomNav, SystemBar). Pushes content automatically via CSS custom properties.
Structure
Anatomy
Visual breakdown of the component's internal structure with BEM class call-outs.
<origam-layout> — root wrapper (①) + inner __wrapper (②) that receives the content. Layout items (Drawer, AppBar…) register themselves and carve space via CSS vars.- 1.origam-layout
- Root
<div>. Emits--origam-layout---position-{top,right,bottom,left}CSS vars reflecting each registered item's reserved space. - 2.origam-layout__wrapper
- Inner wrapper —
width: 100%; height: 100%. Infull-heightmode switches to100vw / 100vh.
API
Props
All props accepted by this component, with their type, default value and description.
- overlapsArray<string>
- List of layout item IDs that should overlap rather than push the content area.
- fullHeightbooleanfalse
- Switches the root and wrapper to 100vw / 100vh, filling the entire viewport.
- idstring
- classstring | Array<string> | object
- stylestring | Array<string> | object | StyleValue
- heightnumber | string
- Overrides the layout height. Accepts a CSS length or a number (→ px).
- maxHeightnumber | string
- Maximum layout height.
- maxWidthnumber | string
- Maximum layout width.
- minHeightnumber | string
- Minimum layout height.
- minWidthnumber | string
- Minimum layout width.
- widthnumber | string
- Overrides the layout width.
- marginboolean | number | string
- marginTopboolean | number | string
- marginLeftboolean | number | string
- marginBottomboolean | number | string
- marginRightboolean | number | string
- marginBlockboolean | number | string
- marginInlineboolean | number | string
- marginInlineStartboolean | number | string
- marginInlineEndboolean | number | string
- marginBlockStartboolean | number | string
- marginBlockEndboolean | number | string
- paddingboolean | number | string
- paddingTopboolean | number | string
- paddingLeftboolean | number | string
- paddingBottomboolean | number | string
- paddingRightboolean | number | string
- paddingBlockboolean | number | string
- paddingInlineboolean | number | string
- paddingInlineStartboolean | number | string
- paddingInlineEndboolean | number | string
- paddingBlockStartboolean | number | string
- paddingBlockEndboolean | number | string
- Border-radius token or boolean.
- roundedTopRightboolean | number | string
- roundedTopLeftboolean | number | string
- roundedBottomLeftboolean | number | string
- roundedBottomRightboolean | number | string
- roundedStartStartboolean | number | string
- roundedStartEndboolean | number | string
- roundedEndStartboolean | number | string
- roundedEndEndboolean | number | string
- elevationTElevation
- Box-shadow elevation token applied to the layout root.
- bgColor
- Background color of the layout root.
- color
- Foreground color inherited by children.
- borderboolean | number | string | TDirectionBoth | Array<TDirectionBoth>false
- Applies a border to the layout root.
- borderTopboolean | number | string
- borderLeftboolean | number | string
- borderBottomboolean | number | string
- borderRightboolean | number | string
- borderBlockboolean | number | string
- borderInlineboolean | number | string
- borderInlineStartboolean | number | string
- borderInlineEndboolean | number | string
- borderBlockStartboolean | number | string
- borderBlockEndboolean | number | string
- borderColorstring
- borderStylestring
- borderTopColorTColor
- borderRightColorTColor
- borderBottomColorTColor
- borderLeftColorTColor
- borderInlineStartColorTColor
- borderInlineEndColorTColor
- borderBlockStartColorTColor
- borderBlockEndColorTColor
API
Slots
Content slots exposed by this component.
- #default
- Primary content area. Place layout items (Drawer, AppBar, OrigamMain…) here.
API
Exposed members
Properties and methods accessible via template ref (defineExpose). Use them for programmatic control.
- (id: string) => ILayerItem | undefined
- Returns the layout metadata (position, size, id) of a registered item by its string ID.
- Ref<Array<ILayerItem>>
- Reactive array of all registered layout items with their current positions and sizes.
- <T extends object>(props: T, exclude?: string[]) => Partial<T>
- Utility to forward a filtered subset of props to a child component.
- 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 into the DOM.
Customisation
CSS variables
CSS custom properties exposed by this component. Override them to customise the component without losing theme compatibility.
- Layout background color.
- Space reserved at the top by registered layout items (e.g. AppBar height). Consumed by OrigamMain as padding-block-start.
- Space reserved at the bottom (e.g. BottomNav height). Consumed by OrigamMain as padding-block-end.
- Space reserved on the left (e.g. Drawer width). Consumed by OrigamMain as padding-inline-start.
- Space reserved on the right (e.g. rail nav width). Consumed by OrigamMain as padding-inline-end.
Inclusion
Accessibility
ARIA roles, keyboard navigation and focus management. Sourced from the real component template.
Keyboard interactions
| Key | Action |
|---|---|
| Tab | Tab navigation flows through the interactive children inside the layout (drawer toggles, nav items, main content). |
Notes
- OrigamLayout renders as a plain <div> — no ARIA landmark role. Use <origam-main> (renders as <main>) and <origam-system-bar> to provide landmark semantics for assistive technologies.
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.
- colorvar(--origam-color__surface---default)
- Default background color for the layout root.
- otherflex
- Layout display mode (flex, column).
- other100vw
- Wrapper width in full-height mode.
- other100vh
- Wrapper height in full-height mode.
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.
Basic page layout
Scrollable main area