sigilUI

Toolbar

A horizontal toolbar for grouping actions, toggles, and separators. Built on Radix Toolbar.

@sigil-ui/componentsReact

Preview

Live preview Interactive

Import

import {
  Toolbar, ToolbarButton, ToolbarSeparator,
  ToolbarToggleGroup, ToolbarToggleItem, ToolbarLink,
} from "@sigil-ui/components";

Usage

<Toolbar>
  <ToolbarToggleGroup type="multiple">
    <ToolbarToggleItem value="bold" aria-label="Bold">
      <BoldIcon className="size-4" />
    </ToolbarToggleItem>
    <ToolbarToggleItem value="italic" aria-label="Italic">
      <ItalicIcon className="size-4" />
    </ToolbarToggleItem>
  </ToolbarToggleGroup>
  <ToolbarSeparator />
  <ToolbarButton>
    <LinkIcon className="size-4" />
    Link
  </ToolbarButton>
</Toolbar>
<Toolbar>
  <ToolbarLink href="/docs">Documentation</ToolbarLink>
  <ToolbarSeparator />
  <ToolbarButton>Settings</ToolbarButton>
</Toolbar>

Token integration

CSS VariableUsed for
--s-surfaceToolbar background
--s-surface-elevatedActive toggle background
--s-textButton and toggle text
--s-text-mutedInactive icon color
--s-borderSeparator and toolbar border
--s-radius-mdToolbar border radius
--s-duration-fastHover/press transition

Props

ToolbarButton

PropTypeDefaultDescription
disabledbooleanfalseDisable the button
classNamestring—Additional CSS classes
childrenReactNode—Button content

ToolbarToggleItem

PropTypeDefaultDescription
valuestring—Toggle value
disabledbooleanfalseDisable this toggle
classNamestring—Additional CSS classes
childrenReactNode—Toggle content

Accessibility

  • Uses role="toolbar" with roving tabindex
  • Arrow keys navigate between toolbar items
  • Provide aria-label for the toolbar and icon-only items