Switch
Instant boolean toggles. Immediate feedback. Modern UX.
Installation
Copy and paste the following code into your project.
Update the import paths to match your project structure.
Anatomy
Variants
Default
With Label
Switch component alongside a label for context.
Text the on call engineer when a service goes down.
Warn the workspace owner at 80% of the plan limit.
Disabled
A disabled state stops interactions.
Always on for production projects.
Available on the Enterprise plan.
API Reference
Switch
| Prop | Type | Default | Description |
|---|---|---|---|
onCheckedChange | (checked: boolean) => void | - | Callback when checked state changes |
disabled | boolean | - | Disables the switch |
Found something to improve?
Notice a bug, typo, or missing detail on this page? Help us make the documentation better by opening a GitHub issue.