Toolbar
@astryxdesign/core v0.7.1 · Toolbar
Usage
Toolbar is a role="toolbar". label is required. start, center, and end are three groups. Arrow keys move focus across them, and Home and End jump to the ends. While an input is being edited, arrows stay with the caret until it reaches the edge of the field.
Hand overflow to OverflowList. Extra actions go into a More menu. The toolbar itself does not measure width.
<script setup lang="ts">
import { Toolbar } from '@astryx-vue/core/Toolbar'
</script>
<template>
<Toolbar label="Formatting">
<template #start>
<button type="button">
Bold
</button>
<button type="button">
Italic
</button>
</template>
</Toolbar>
</template>Anatomy
| Element | Description |
|---|---|
| Outer chrome | Section-owned container that supplies the toolbar surface, padding, and selected divider edges. |
| Toolbar | Named toolbar row that owns toolbar semantics and the start, optional center, and end layout. |
Best practices
| Guidance | Practice |
|---|---|
| Do | Name the toolbar for its job, for example “Formatting”. |
| Do | Put a long set of actions in an OverflowList instead of letting buttons wrap out of the bar. |
| Avoid | Do not nest a toolbar inside a toolbar. Arrow keys stop at the inner boundary. |
Examples
Bulk Actions
After a multi-select, the count stays at the start and batch actions stay at the end.
Card Header
The card title sits on the left. Icon actions sit on the right.
Sizes
Small, medium, and large side by side. Size cascades to the buttons inside.
Table Filter
Search leads the row. Status, priority, and customer sit beside it, with a live result count.
Tab Navigation
Tabs sit in the start group. One action sits at the end.