Toolbar
Horizontal bar hosting a title, prepend/append action zones and content. Supports collapse, flat and floating modes with density and elevation control.
Preview
Rendering the live preview…
defaultRendering the live preview…
flatRendering the live preview…
primaryRendering the live preview…
compactRendering the live preview…
roundedStructure
Anatomy
Visual breakdown of the component's internal structure with BEM class call-outs.
<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
All props accepted by this component, with their type, default value and 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
Content slots exposed by this component.
- #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
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 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.
Customisation
CSS variables
CSS custom properties exposed by this component. Override them to customise the component without losing theme compatibility.
- 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
Accessibility
ARIA roles, keyboard navigation and focus management. Sourced from the real component template.
ARIA roles
Keyboard interactions
| Key | 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.
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.
- 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.
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.
Basic toolbar
Colored & elevated
Flat & floating