Main
Content area of an OrigamLayout page. Reads the layout-item CSS offset vars (position-top/right/bottom/left) to auto-pad itself around Drawers, AppBars and BottomNavs. Supports a scrollable inner mode.
Structure
Anatomy
Visual breakdown of the component's internal structure with BEM class call-outs.
<origam-main> — ① root <main> that reads layout offset CSS vars, ② __wrapper (becomes __scroller in scrollable mode with overflow-y: auto).- 1.origam-main
- Root
<main>. Appliespadding-inline-start/end/block-start/endfrom layout offset CSS vars (--origam-layout---position-*). flex: 1 0 auto by default. - 2.origam-main__wrapper / .origam-main__scroller
- Inner wrapper. In
scrollablemode the class becomes__scrollerand addsoverflow-y: auto; flex: 1 1 auto. Layout offsets are reset to 0 inside the scroller so nested layout items don't double-count.
API
Props
All props accepted by this component, with their type, default value and description.
- scrollablebooleanfalse
- When true, the root switches to position: absolute + display: flex and the inner __scroller wrapper gets overflow-y: auto. This confines scrolling to the main content area rather than the whole page.
- tagstring'main'
- Root HTML element tag. Defaults to <main> for landmark semantics.
- idstring
- classstring | Array<string> | object
- stylestring | Array<string> | object | StyleValue
- paddingboolean | number | string
- Padding shorthand. Note: layout offset padding is applied automatically — this prop adds extra padding on top.
- 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
- marginboolean | number | string
- Margin shorthand.
- 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
- borderboolean | number | string | TDirectionBoth | Array<TDirectionBoth>false
- Applies a border to the main area.
- 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
- 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
- heightnumber | string
- Override the main area height.
- maxHeightnumber | string
- maxWidthnumber | string
- Maximum width of the main area.
- minHeightnumber | string
- minWidthnumber | string
- widthnumber | string
- Override the main area width.
- elevationTElevation
- Box-shadow elevation token.
- bgColor
- Background color of the main area.
- color
- Foreground color inherited by children.
API
Slots
Content slots exposed by this component.
- #default
- Page content. Rendered inside __wrapper (and __scroller in scrollable mode).
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 a child.
- 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.
- Flex shorthand for the root. Allows the main area to grow and fill the layout.
- Maximum width of the main area.
- Transition duration when layout items push/pull the main area (e.g. drawer open/close).
- Properties transitioned when the layout offsets change.
- Easing of the layout push transition.
- Maximum width of the scroller inner div.
- Position of the scroller inner div.
Inclusion
Accessibility
ARIA roles, keyboard navigation and focus management. Sourced from the real component template.
ARIA roles
Keyboard interactions
| Key | Action |
|---|---|
| Tab | Navigates to the first interactive element inside the main content area. |
Notes
- OrigamMain renders as <code><main></code> by default, providing a landmark region for assistive technologies. There should be only one <code><main></code> landmark per page.
- Pair OrigamMain with a "Skip to main content" link (<code><a href="#main-id"></code>) targeting its rendered id for keyboard-only users.
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.
- other1 0 auto
- Default flex shorthand.
- durationvar(--origam-motion__duration---medium)
- Duration of the push-content transition when layout items move.
- colorvar(--origam-color__surface---default)
- Default background color for the main area.
- colorvar(--origam-color__text---primary)
- Default foreground color.
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.
Inside a Layout
Scrollable mode