Skip to content
界面图谱Interface Atlas
☰
中文
ComponentsNavigation / Controls

Toolbar

工具条

Aliases:工具条工具栏操作栏快捷操作那一排toolbartool bar

What is it

A strip of controls that act on the current view or selection, grouped by function and split by separators. A toolbar runs actions; a menu lists options; site navigation says where to go. Think of an editor's bold/italic bar, an image viewer's rotate/download bar, or a list page's bulk-action bar.

Name disambiguation

A toolbar is a row of action buttons that fire immediately; a menubar is a row of menu triggers that open lists requiring a second choice; a navbar is a set of destinations that change the route or page. Decide by what happens after the click: run an action → toolbar; open options → menu; go somewhere else → navbar.

Interactive playground

Try it. Make an informed choice.

Arrow through the toolbar buttons, fire a few actions and watch the toggle states.

Loading lab…

What to look for

  • 01Group buttons semantically so the strip is a single tab stop
  • 02Toggle buttons expose pressed / unpressed state

✓ When to use

  • A cluster of frequent actions on the current view or selection (format, bulk ops)
  • Actions must stay visible and one click away
  • Icons carry the meaning and labels can be dropped

✕ When not to use

  • Rare or debatable actions — hide them in an overflow menu
  • Picking one option from a set — that is a menu or select
  • Global site destinations — that is a navbar or sidebar

Variants

Icon toolbar

图标工具条

Icon-only buttons with tooltips for meaning

Formatting toolbar

排版工具条

Bold / italic / align text actions with toggle states

Contextual toolbar

上下文工具条

Appears only on selection and hides when the selection clears

Implementation

flexgapborder-radiusbackgroundtransition

The container is role="toolbar" with an aria-label; cluster related controls in role="group" regions each labeled, and make separators 1px rules marked aria-hidden. Keyboard uses roving tabindex — one tab stop for the strip, Left/Right (or Up/Down for a vertical bar) moves inside, Home / End jump to the ends. Toggle buttons use aria-pressed. On narrow screens wrap or collapse into an overflow menu.

Platform API

role="toolbar"aria-labelroving tabindex

In code

The exact names this thing goes by in each ecosystem — use the row that matches your project.

FrameworkName
ARIA APGToolbar
RadixToolbar
MUIToolbar

Related concepts

Not to be confused with

Navbar顶部导航栏

A navbar navigates to destinations; a toolbar runs actions in the current context.

Menu菜单

A menu opens a list to choose from; a toolbar button acts on click.

Applicable styles

Sources

Markdown for agents · JSON