Toolbar

A row of controls the keyboard treats as one stop: Tab reaches it, the arrows walk it, Tab again leaves.

01Preview

01
Full screen

02Installation

npx shadcn@latest add https://aiellie.app/r/toolbar.json

03API reference

06
From the Base UI documentation

A container for grouping a set of controls, such as buttons, toggle groups, or menus. Renders a <div> element.

Props

PropTypeDefaultDescription
loopFocusbooleantrueIf true, using keyboard navigation will wrap focus to the other end of the toolbar once the end is reached.
disabledboolean--
orientationToolbar.Root.Orientation'horizontal'The orientation of the toolbar.
classNamestring | ((state: Toolbar.Root.State) => string | undefined)-CSS class applied to the element, or a function that returns a class based on the component's state.
styleReact.CSSProperties | ((state: Toolbar.Root.State) => React.CSSProperties | undefined)-Style applied to the element, or a function that returns a style object based on the component's state.
renderReactElement | ((props: HTMLProps, state: Toolbar.Root.State) => ReactElement)-Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.

Data Attributes

AttributeTypeDescription
data-orientation'horizontal' | 'vertical'Indicates the orientation of the toolbar.
data-disabled-Present when the toolbar is disabled.