unstable_Toolbar API
- Component status:
-
unstable
Import
Section titled “Import”import { unstable_Toolbar as Toolbar } from "@stratakit/structures";// ORimport * as Toolbar from "@stratakit/structures/unstable_Toolbar";Toolbar.Group
Section titled “Toolbar.Group”
Base element:
<div>
A toolbar for grouping related interactive elements.
Follows the ARIA Toolbar pattern for reducing the number of tab stops.
Example:
<Toolbar.Group variant="solid"> <Toolbar.Item render={…} /> <Toolbar.Item render={…} /> <Toolbar.Item render={…} /></Toolbar.Group>A divider can be displayed between items by rendering the Divider component.
<Toolbar.Group variant="solid"> <Toolbar.Item render={…} /> <Divider orientation="vertical" /> <Toolbar.Item render={…} /> <Toolbar.Item render={…} /></Toolbar.Group>variant
Section titled “variant” Type:
"solid" (required) Must be set to "solid" for now.
orientation
Section titled “orientation” Type:
"horizontal" | "vertical" | undefined (optional) Default:
"horizontal" The orientation of the toolbar.
Additional props
Section titled “Additional props”Toolbar.Item
Section titled “Toolbar.Item”
Base element:
<button>
An item within the toolbar.
Should be used with the render prop.
If rendering an IconButton, be sure to append #icon-large to the icon URL.
Example:
<Toolbar.Item render={<IconButton variant="ghost" icon={`${placeholderIcon}#icon-large`} />}/>render
Section titled “render” Type:
(props: P) => React.ReactNode | React.ReactElement (required) Allows the component to be rendered as a different HTML element or React component. The value can be a React element or a function that takes in the original component props and gives back a React element with the props merged.
Check out the Composition guide for more details.