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

Anatomie

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

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

Toutes les props acceptées par ce composant, avec leur type, valeur par défaut et 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

Emplacements de contenu exposés par ce composant.

#default
Page content. Rendered inside __wrapper (and __scroller in scrollable mode).

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

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.

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

Accessibilité

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

Rôles ARIA

main

Interactions clavier

Interactions clavier
ToucheAction
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.

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

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.

Inside a Layout

vue

Scrollable mode

vue