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
Anatomie
Décomposition visuelle de la structure interne du composant avec les appels de classes BEM.
<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
Toutes les props acceptées par ce composant, avec leur type, valeur par défaut et 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
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
Interactions clavier
| Touche | 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.
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.
- 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.
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
Scrollable mode