Search documentation

Find a component or a docs page

Toggle

A two-state button that can be either on or off.

Usage

Default

Outline

With icon

Icon-only toggles need an aria-label. Mark an icon next to text with data-icon="inline-start" or "inline-end" so the toggle tightens the padding on that side.

Sizes

Pressed

Disabled

In a form

Components

ComponentBuilt usingSource
TogglePhlex
ToggleControllerStimulus JS