Components
GlassSwitch
A glassmorphism-styled toggle switch powered by Radix UI with optional label support.
Preview
Usage
Without Label
Controlled
Disabled
Props
| Prop | Type | Default | Description |
|---|---|---|---|
label | string | — | Optional label rendered beside the switch |
id | string | — | HTML id, links the label for accessibility |
checked | boolean | — | Controlled checked state |
defaultChecked | boolean | — | Initial state (uncontrolled) |
onCheckedChange | (checked: boolean) => void | — | Callback when state changes |
disabled | boolean | false | Disables the switch |
All Radix Switch.Root props are also accepted.