search⌘K

Toggle Button

Last Updated: September 2026

Toggle buttons are controls that allow users to turn a control, mode, or portion of the UI on or off. They support both labeled and icon only variants as well as various sizes for flexibility in application.

Anatomy

link
Dotted grid scale: 8px
  1. 1Optional Container Border
  2. 2Icon
  3. 3Prefix
  4. 4Label
  5. 5Suffix

Variants

link

Labeled

Text label with optional prefix icon. Clearest for most toggles.

Icon-only

prefixIcon without children. Requires aria-label.

Pressed

defaultPressed or controlled pressed shows the active state.

Outline off

outline={false} removes the border on the unpressed state.

Sizes

link

Toggle buttons support 3 sizes: S, M, and L.

Line spacing scale: 8px
28px
36px
48px

Usage Guidelines

link

When to use

  • •To toggle a binary setting on or off (bold, starred, filtered).
  • •When pressed state should stay visible after the click.
  • •In toolbars where several independent toggles sit side by side.

When not to use

  • •For exclusive options in a segmented set — use ButtonGroup.
  • •For one-shot actions (save, submit) — use Button.
  • •For on/off settings with a clear track affordance — consider a Switch pattern.
checkDo

Use toggles for durable on/off state the user can reverse.

closeDon't

Don't use ToggleButton for one-shot actions like Save or Submit.

checkDo

Provide aria-label on icon-only toggles.

closeDon't

Don't ship icon-only toggles without an accessible name.

Behaviors

link

Pressed state

  • •Use pressed / defaultPressed plus onPressedChange for controlled or uncontrolled state.
  • •Pressed is exposed to assistive tech as aria-pressed.

Disabled state

  • •Set disabled=true to prevent toggling.
  • •Disabled toggles keep their pressed appearance but are not interactive.

Content Guidelines

link

Labels

  • •Name the state or attribute being toggled ('Bold', 'Starred'), not the action ('Click').
  • •Keep labels short — one or two words.

Icons

  • •prefixIcon reinforces the label; suffixIcon only renders when children are present.
  • •Icon-only toggles need a clear, standard symbol plus aria-label.

Accessibility

link

Text & Labels

  • •Provide visible text or aria-label.
  • •Icon-only toggles must include aria-label.

ARIA attributes

  • •aria-pressed reflects the pressed state.
  • •value can associate the toggle with a group when needed.

Keyboard Support

  • •Tab → focus.
  • •Space / Enter → toggle pressed state.

WCAG Compliance Standards

FAQs

link

ToggleButton vs ButtonGroup?

ToggleButton is for independent on/off state. ButtonGroup is for choosing among related options (single or multi-select).

How do I control the pressed state?

Pass pressed and onPressedChange for controlled usage, or defaultPressed for uncontrolled.

Can I put a suffix icon on an icon-only toggle?

No — suffixIcon only renders when children (a label) are present. Use prefixIcon for icon-only.

link