Tool bar

A responsive container that groups buttons and menus, and automatically moves items into an overflow menu when space is limited.

UsageCodeAccessibility
DuplicateReorderExport
More
Rename lessonDelete lesson
<sl-tool-bar contained aria-label="Lesson builder">
  <sl-button fill="outline">
    <sl-icon name="far-copy"></sl-icon>
    Duplicate
  </sl-button>
  <sl-button fill="outline">
    <sl-icon name="far-arrow-down-wide-short"></sl-icon>
    Reorder
  </sl-button>
  <sl-tool-bar-divider></sl-tool-bar-divider>
  <sl-button fill="outline">
    <sl-icon name="far-arrow-up-from-bracket"></sl-icon>
    Export
  </sl-button>
  <sl-menu-button fill="outline">
    <div slot="button">More</div>
    <sl-menu-item>
      <sl-icon name="far-pen"></sl-icon>
      Rename lesson
    </sl-menu-item>
    <sl-menu-item>
      <sl-icon name="far-trash"></sl-icon>
      Delete lesson
    </sl-menu-item>
  </sl-menu-button>
</sl-tool-bar>

When to use

Contextual Actions

Use to place actions close to the content or region they affect (for example, controls for a list, table, editor, or card). It works best for a consistent action set for that view (for example, filter, sort, export, edit, insert actions). Use dividers to separate groups (for example, “view”, “manage”, “format”) so users can scan quickly.

Bulk Actions

Use to expose actions that apply to multiple items at once (for example, “Move”, “Delete”, “Assign”, “Export”) when the user selects one or more items in a list or table. Keep the most important bulk actions visible and move the rest into overflow.

Action density

Use when the same set of actions must remain available across different widths. Overflow keeps the layout stable while ensuring secondary actions stay accessible.

When not to use

Too Many Actions

If you have a long list of actions, or actions that are infrequent and not tied to the current view/content, avoid a toolbar. Move actions into a more suitable pattern (context menus, inline actions, progressive disclosure) or place them in a more global location (page header, navigation, or settings) so the toolbar stays scannable and purposeful.

Don’t use the toolbar for navigation between pages/sections or as the primary control in multi-step flows. If you only need a small set of primary actions (especially in step-by-step layouts), consider using a Button Bar instead.

Anatomy

ItemNameDescriptionOptional
1ContainerWraps all actions and defines layout, spacing, and optional surface (contained).no
2ItemA single action element placed in the toolbar (button, menu button, or buttons group).no
3DividerA visual separator between groups; also becomes a separator inside overflow.yes
4Overflow triggerA “more actions” control that appears when items don’t fit.no
5Overflow menuThe menu that contains hidden actions (keeps order and group separation).no

Variants

These options change the toolbar’s appearance so it stays clear and readable across different surfaces and action styles.

  • Fill: Controls the look of the actions inside the toolbar. Use Outline when actions need stronger emphasis and clearer boundaries, or use Ghost when actions should feel lighter and blend into the interface.
  • Inverted: Switches the toolbar styling for dark or inverted surfaces. Use it to maintain contrast and readability when the toolbar sits on a darker background.
  • Contained: Adds a surface around the toolbar (background and padding). Use it to visually separate the toolbar from surrounding content or to make it feel like a distinct control area.

States

These states describe what users see when the toolbar is available, constrained, or unavailable.

  • Default: Actions are available and visible until overflow is needed.
  • Overflow: Some actions move into the overflow menu when space is limited.
  • Disabled: The toolbar and its actions are not interactive.

Figma Properties

With these options you can adjust the appearance of the toolbar in Figma.

Toolbar

Properties for the main toolbar component used by designers. Some options (like Overflow, Item 3–5, and Divider 1–5) are for previewing compositions and states in Figma.

ItemOptionsDescription
FillGhost OutlineSets the visual style applied to actions inside the toolbar.
InvertedbooleanSwitches the toolbar to an inverted appearance for dark surfaces.
ContainedbooleanAdds a surface treatment (background and padding) around the toolbar.
OverflowbooleanPreview-only toggle to show the overflow state in Figma.
Item 3–5booleanPreview-only toggles to add/remove extra items in the Figma example.
Divider 1–5booleanPreview-only toggles to add/remove dividers between groups in the Figma example.

Toolbar item

Properties for the nested toolbar item used inside the toolbar to swap between the supported control types.

ItemOptionsDescription
ItemButton Menu Button GroupSwaps the supported action type used for a single toolbar item.
FillOutline GhostMatches the item’s style to the toolbar style where needed.
InvertedbooleanMatches the item’s appearance to inverted surfaces where needed.

Toolbar Group

Properties for the nested toolbar group used inside a toolbar item to build grouped actions and preview the group overflow behaviour.

ItemOptionsDescription
OverflowbooleanSwitches a button group between expanded buttons and a collapsed menu-style version.
InvertedbooleanMatches the group appearance to inverted surfaces where needed.
Button 3–5booleanPreview-only toggles to control how many grouped actions are shown in the example.

Behaviours

Controls are organised into logical groups to improve scannability and usability. When space is limited, groups help determine how items collapse into the overflow menu. Dividers should only be used to separate meaningful groups. Avoid using dividers between every item.

Handles overflow

When space is limited, especially on smaller screens, actions move into the overflow menu, while the remaining actions will stay visible. In the overflow dropdown, groups are separated with dividers to preserve structure and clarity.

Consistent styling and clear icon actions

The toolbar applies a consistent visual style across its items (for example, matching fill and inverted appearance) so actions look like part of the same system. If you use icon-only actions, ensure they remain understandable through labels and/or tooltips, and avoid placing many icon-only actions without strong familiarity or supporting text.

BoldItalicUnderlineCutCopyPaste
Insert
Special characterPage break
<sl-tool-bar aria-label="Essay editor">
  <sl-button fill="outline">
    <sl-icon name="far-bold"></sl-icon>
    Bold
  </sl-button>
  <sl-button fill="outline">
    <sl-icon name="far-italic"></sl-icon>
    Italic
  </sl-button>
  <sl-button fill="outline">
    <sl-icon name="far-underline"></sl-icon>
    Underline
  </sl-button>
  <sl-tool-bar-divider></sl-tool-bar-divider>
  <sl-button fill="outline">
    <sl-icon name="far-scissors"></sl-icon>
    Cut
  </sl-button>
  <sl-button fill="outline">
    <sl-icon name="far-copy"></sl-icon>
    Copy
  </sl-button>
  <sl-button fill="outline">
    <sl-icon name="far-paste"></sl-icon>
    Paste
  </sl-button>
  <sl-tool-bar-divider></sl-tool-bar-divider>
  <sl-menu-button fill="outline">
    <div slot="button">Insert</div>
    <sl-menu-item>
      <sl-icon name="far-font"></sl-icon>
      Special character
    </sl-menu-item>
    <sl-menu-item>
      <sl-icon name="far-arrow-turn-left-down"></sl-icon>
      Page break
    </sl-menu-item>
  </sl-menu-button>
</sl-tool-bar>

Tool bar divider API

A visual separator used to group related items within the tool bar.

Properties

NameAttributeTypeDefaultDescription
invertedinvertedboolean | undefinedSet this to true to invert the color of the divider. This should be used when the tool-bar is displayed on a dark background.

Tool bar API

A responsive container that groups buttons and menus. It automatically moves items into an overflow menu when space is limited.

Properties

NameAttributeTypeDefaultDescription
alignalign'start' | 'end' | undefined'start'The horizontal alignment within the tool-bar.
containedcontainedboolean | undefinedfalseIf true, the tool-bar will have a border (when there is no inverted set) and padding around it. Use this when you want the tool-bar to be visually distinct from surrounding content.
disableddisabledboolean | undefinedfalseIf true, the tool-bar is disabled and cannot be interacted with.
fillfill'solid' | 'outline' | 'link' | 'ghost' | undefined'solid'The fill of buttons and menu buttons (also overflow menu button).
invertedinvertedboolean | undefinedfalseUse this if you want the menu button that appears when the tool bar overflows to use the "inverted" variant. This also overrides all slotted button and menu-button variants to inverted when set.

Methods

NameParametersReturnDescription
focusvoidDelegate focus to the roving tabindex controller so the first focusable item receives focus.
refreshvoidRe-maps slotted elements, measures their widths, and recalculates which items are visible vs. moved into the overflow menu. Called automatically on slot changes and DOM mutations, but you may need to call it manually when using nested slots (which don't trigger slotchange or MutationObserver).
forceRecalculationvoidForces a recalculation of the tool-bar layout using a debounced measurement.

In most cases, the tool-bar reacts automatically to size changes and DOM mutations, or can be updated explicitly by calling refresh. Call this method only in advanced scenarios where those mechanisms are insufficient, such as when the layout is affected by changes outside the tool-bar (e.g. complex nested slots or container size changes that are not observed).

When invoked, any pending recalculation is canceled and a new one is scheduled with a 200ms delay. Once the timeout elapses, the tool-bar temporarily reveals the first hidden item, measures the wrapper and items, and internally triggers a resize/measurement pass to recompute which items should be visible or moved into the overflow menu.

Slots

NameDescription
defaultThe tool bar items.

CSS Parts

NameDescription
wrapperThe wrapper element that contains the tool bar items.

Keyboard interactions

CommandDescription
TabMoves focus into the tool bar (to the first focusable element) and out of it.
Arrow LeftMoves focus to the previous focusable element in the tool bar.
Arrow RightMoves focus to the next focusable element in the tool bar.
HomeMoves focus to the first item.
EndMoves focus to the last item.
Enter/SpaceActivates the focused button or opens a menu.

WAI-ARIA

In the component itself we use multiple aria-attributes to assure the component works well with a range of assistive technologies. For some attributes however it is not possible for the Design System to add a meaningful value, because it relies on the context or way a component is used.

Attributes that we recommend you add in certain scenarios are mentioned below.

AttributeValueDescription
aria-labelstringDefines a string that labels the tool bar (describes its purpose). This helps screen reader users understand what the group of actions is for.
aria-labelledbystringLinks the tool bar to an existing heading or element that describes it, instead of using aria-label.
Interactive example