Forms

Switch

Toggle a binary setting with a native control and an accessible label.

Basic usage

Keep the label stable in both states. Use defaultChecked to start with the setting on, or checked with onCheckedChange to control the choice.

Receive updates about your workspace.

API

Key props and defaults.

PropValues and behaviorDefault
checked / defaultCheckedbooleanfalse
onCheckedChange(details) => void—
variantsolid | outlinesolid
labelPositionstart | endend
roundedbooleantrue