Components
All components
Inputs

Switch

A squared on/off toggle — on is a filled yellow track. Controlled or uncontrolled.

Preview

Preview
light
dark

Code

<Switch defaultChecked label="Notifications" />

Import from @/components/ui.

Props

PropTypeDefaultDescription
checkedbooleanControlled state.
defaultCheckedbooleanfalseUncontrolled initial state.
onChange(v: boolean) => voidChange handler.
labelstringInline label.

Related