Toggle

Single press-to-latch control on bits-ui Toggle. Pressed state eases through the muted fill, and the focus ring snaps in on keyboard activation without layout shift.

Usage

Variants

Sizes

With text

Pair an icon with a text label inside the Toggle for labelled formatting controls.

States

default
outline

API reference

Inherits bits-ui Toggle.Root props via spread. Pressed is two-way bindable; aria-pressed drives the muted fill.

PropTypeDescription
boolean (bindable)Whether the toggle is currently pressed. Two-way bindable.
'default' | 'outline'Presentation. Outline renders a border that stays through all states.
'sm' | 'default' | 'lg'Height and horizontal padding. Icons auto-size to match.
booleanDisables the toggle and drops opacity to 50%.
(pressed: boolean) => voidFires whenever the pressed state changes.
HTMLButtonElement | nullTwo-way-bindable element reference.
stringMerged onto the root via tailwind-merge.