Toggle
Displays a toggle built on the Base UI Toggle primitive: a two-state button for options like bold, italic, or mute.
Installation
Bash
Usage
Examples
Variants
Sizes
Examples
Variants and sizes
API reference
Toggle
Extends the Base UI Toggle
primitive — all its props apply. Give icon-only toggles an aria-label.
| Prop | Type | Default |
|---|---|---|
variant | "default" | "outline" | "default" |
size | "default" | "sm" | "lg" | "default" |
pressed / defaultPressed | boolean | false |
onPressedChange | (pressed: boolean) => void | — |
disabled | boolean | false |
toggleVariants is also exported for styling custom elements.