Toolbar
Horizontal bar hosting a title, prepend/append action zones and content. Supports collapse, flat and floating modes with density and elevation control.
Aperçu
Rendu de l’aperçu en cours…
defaultRendu de l’aperçu en cours…
flatRendu de l’aperçu en cours…
primaryRendu de l’aperçu en cours…
compactRendu de l’aperçu en cours…
roundedStructure
Anatomie
Décomposition visuelle de la structure interne du composant avec les appels de classes BEM.
<origam-toolbar> — 5 internal parts. The __wrapper arranges prepend, title, content and append in a row; the optional shadow line ① marks the bottom edge.- 1.origam-toolbar
- Root element. Renders as
<header>by default. Hosts the box-shadow and z-index. - 2.origam-toolbar__prepend
- Leading zone. Rendered only when the #prepend slot has content. Margin-end: auto pushes the title to the right.
- 3.origam-toolbar__title
- Title zone. Contains an
OrigamTitleby default, or the #title slot. - 4.origam-toolbar__content
- Flexible center area. flex-grow: 1 so it absorbs all remaining space.
- 5.origam-toolbar__append
- Trailing zone. Rendered only when the #append slot has content. Margin-start: auto pushes it to the far right.
API
Props
Toutes les props acceptées par ce composant, avec leur type, valeur par défaut et description.
- collapsebooleanfalse
- Collapses the toolbar to a compact pill shape (max-width: 112px) with rounded end. Useful for scrollable-aware app-bar patterns.
- flatbooleanfalse
- Removes the box-shadow. Use when the toolbar sits on a surface that already provides visual separation.
- floatingbooleanfalse
- Switches layout to inline-flex so the toolbar shrinks to its content width instead of spanning the full row.
- titlestring
- Toolbar title rendered inside the title slot as an OrigamTitle. Can also be overridden via the #title slot.
- modelValueboolean
- v-model binding for the active / visible state. When false, the toolbar is hidden (e.g. collapsed app-bar on scroll).
- tagstring'header'
- Root HTML element. Defaults to header for semantic page structure.
- idstring
- classstring | Array<string> | object
- stylestring | Array<string> | object | StyleValue
- borderboolean | number | string | TDirectionBoth | Array<TDirectionBoth>false
- Applies a border. Switches box-shadow to none in border-variant mode.
- 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. true uses the theme default radius.
- 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. Use 0 to remove the default shadow without flat prop.
- Adjusts height: default=56px, compact=40px, prominent=80px.
- color
- Foreground (text/icon) color. Accepts a semantic intent or custom CSS color.
- bgColor
- Background color. Overrides the default surface background.
- paddingboolean | number | string
- Inner padding shorthand. Accepts spacing token or CSS value.
- 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
- Outer 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
- position
- CSS position strategy: static, fixed, sticky, absolute, relative.
- topnumber | string
- bottomnumber | string
- leftnumber | string
- rightnumber | string
- heightnumber | string
- Overrides the toolbar height (default driven by density token).
- maxHeightnumber | string
- maxWidthnumber | string
- minHeightnumber | string
- minWidthnumber | string
- widthnumber | string
- Overrides the toolbar width. Default is 100%.
- activeboolean | IStateEffectConfigfalse
- Forces the active visual state on the toolbar.
- activeClassstring
- hoverboolean | IStateEffectConfig
- hoverClassstring
- fontSizeTFontSize
- fontWeightTFontWeight
- lineHeightTLineHeight
- letterSpacingTLetterSpacing
API
Slots
Emplacements de contenu exposés par ce composant.
- #default
- Full content override. When used, the internal wrapper (prepend/title/content/append) is replaced entirely.
- #prepend
- Leading zone (left on LTR). Typically holds a nav icon or back button. Rendered only when the slot has content.
- #title
- Title zone. Falls back to rendering an OrigamTitle with the title prop when the slot is empty.
- #content
- Flexible center zone. Grows to fill the available space between prepend/title and append.
- #append
- Trailing zone (right on LTR). Typically holds action buttons or an overflow menu.
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 child components.
- Ref<string>
- Reactive CSS string for the computed toolbar styles (used by DefaultsProvider).
- 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.
- Toolbar background color.
- Foreground (text/icon) color.
- Default height (56px). Overridden per density variant.
- Height in density="compact" mode (40px).
- Height in density="prominent" mode (80px).
- Box shadow. Set to none via the flat prop.
- Transition duration for height, transform, and box-shadow.
- Z-index of the toolbar when position is fixed or sticky.
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 | Moves focus through interactive children (buttons, links) in the toolbar. |
Notes
- When rendered as <header> (default tag), the toolbar acts as a ARIA banner landmark. Ensure only one banner per page.
- Icon-only buttons inside the toolbar must carry an aria-label.
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.
- colorvar(--origam-color__surface---default)
- Default toolbar background.
- dimensionvar(--origam-toolbar---height-default, var(--origam-space---14))
- Default height (56px).
- dimensionvar(--origam-space---10)
- Compact density height.
- shadowvar(--origam-shadow---sm)
- Default shadow.
- durationvar(--origam-motion__duration---medium)
- Height/shadow transition duration.
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.
Basic toolbar
Colored & elevated
Flat & floating