Components
Toolbar
Row of ghost buttons that share one tab stop and move focus with the arrow keys.
import { Toolbar } from "@openperf/deft";
<Toolbar.Root aria-label="Trace actions">
<Toolbar.Button>Expand all</Toolbar.Button>
<Toolbar.Button>Collapse all</Toolbar.Button>
</Toolbar.Root>;When to use
| Need | Component |
|---|---|
| Always-visible actions on one view or panel | Toolbar |
| Actions on the rows selected in a list | Action bar |
| Search field and filters above a list | Filter bar |
| A single action | Button |
| More actions than fit in a row | Menu |
Anatomy
<Toolbar.Root>
<Toolbar.Button />
<Toolbar.Separator /> {/* thin vertical line between groups */}
<Toolbar.Group /> {/* Group, Link and Input: Base UI parts without Deft styles */}
</Toolbar.Root>The root wraps its items onto new lines and is shifted 8px to the left, the horizontal padding of an sm button, so the label of the first button lines up with the content around the toolbar. Reset the shift with className="ml-0" when the toolbar sits inside a padded box.
Keyboard
The toolbar is one tab stop. The arrow keys move focus between its items and wrap from the last item to the first unless loopFocus={false}. A disabled or loading Toolbar.Button is skipped.
API
Toolbar.Root
Declares no props of its own. Set aria-label to name the group; the Base UI props reached for most are orientation and loopFocus.
Toolbar.Button
Takes the props of Button.Root from Button, including loading, shape, render and a promise-returning onClick. Two defaults differ:
Prop
Type