Main

Layout & Structure
stable

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.

Anatomy of OrigamMainSchematic of the Main component with its wrapper child and scrollable modifier. origam-main__wrapper → origam-main__scroller (scrollable mode only) 1 2 origam-main (tag: main)
Anatomy of <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>. Applies padding-inline-start/end/block-start/end from layout offset CSS vars (--origam-layout---position-*). flex: 1 0 auto by default.
2.origam-main__wrapper / .origam-main__scroller
Inner wrapper. In scrollable mode the class becomes __scroller and adds overflow-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.

scrollable
boolean
false
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.
tag
string
'main'
Root HTML element tag. Defaults to <main> for landmark semantics.
id
string
class
string | Array<string> | object
style
string | Array<string> | object | StyleValue
padding
boolean | number | string
Padding shorthand. Note: layout offset padding is applied automatically — this prop adds extra padding on top.
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
Margin shorthand.
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 main area.
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 token or boolean.
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
height
number | string
Override the main area height.
maxHeight
number | string
maxWidth
number | string
Maximum width of the main area.
minHeight
number | string
minWidth
number | string
width
number | string
Override the main area width.
elevation
TElevation
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

main

Keyboard interactions

Keyboard interactions
KeyAction
TabNavigates to the first interactive element inside the main content area.

Notes

  • OrigamMain renders as <code>&lt;main&gt;</code> by default, providing a landmark region for assistive technologies. There should be only one <code>&lt;main&gt;</code> landmark per page.
  • Pair OrigamMain with a "Skip to main content" link (<code>&lt;a href="#main-id"&gt;</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.

Source
other
1 0 auto
Default flex shorthand.
duration
var(--origam-motion__duration---medium)
Duration of the push-content transition when layout items move.
color
var(--origam-color__surface---default)
Default background color for the main area.
color
var(--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

vue

Scrollable mode

vue