Toggle

Button

Stateful toggle button with on/off states, icon support, and form integration

Basic Usage

Variants

Sizes

With Text

Disabled

Controlled

Usage Guidelines

When to Use

  • Toolbar toggles
  • View mode switching
  • Boolean button states

Accessibility

  • aria-pressed state
  • State change announced

Performance

  • CSS-only pressed state
  • Minimal re-renders

Common Mistakes

  • Unclear pressed state
  • Using for binary data (use Switch)

Frequently Asked Questions

Toggle is a button that stays pressed. Switch is for binary on/off states.
Yes, Toggle visually indicates its pressed/unpressed state.

View on GitHub

See the full source code on GitHub