Skip to main content
Kaleidoscope

Toolbar

Useful for configuring options for a particular item in an editor or a form, when you don't want the options to be in-line with the item

Default

What you get out of the box with this component:

Editable example

Auto-positioned relative to an element

Using the ToolbarPositionType.Element position type, you can set an element for the toolbar to position relative to, and it will automatically update. Pass a DOM node as the element prop for this to work.

Editable example

Toolbar children

We provide three out-of-the-box toolbar children:

  • ToolbarButton
  • ToolbarPopover
  • ToolbarSeparator

ToolbarButton

Toolbar buttons are simple extensions to the IconButton component; they also take an optional selected prop to indicate whether or not the button is active.

Editable example

ToolbarPopover

The ToolbarPopover is a regular Popover with better defaults for use within a Toolbar. Refer to the for usage instructions.

Editable example

ToolbarSeparator

A simple way to segment the toolbar is using a separator:

Editable example

Best practices

  • Only make use of a Toolbar when you are okay with controls being hidden behind selection or hover. By default, these controls won't have very strong discoverability or ease of access.
  • When using the ToolbarButton component, always provide a label, either through the tooltip prop, or passing an aria-label prop if not

Accessibility

  • This component doesn't provide any accessibility provisions for screen readers