Skip to main content

Toggle

Switch between on & off states, and group them with single or multiple selection, built on Base UI.

View as Markdown

Installation

Component API

PropTypeDefaultDescription
iconReactNode-Shown while not pressed.
Shown while not pressed.
pressedIconReactNode-Shown while pressed.
Shown while pressed.
labelstring-
defaultPressedbooleanfalse
pressedboolean-Controlled state.
Controlled state.
onPressedChange(pressed: boolean) => void-
valuestring-
aria-labelstring-
sizesm | mdmdThe button's footprint.
The button's footprint.
shapenone | rounded | pillrounded
disabledbooleanfalse
animatedbooleantrue
classNamestring-
focusboolean | stringtrue