Components
Switch
A control that allows the user to toggle between checked and unchecked states.
Installation
pnpm dlx shadcn@latest add https://reui.io/r/switch.json
Examples
Default
Loading
Mono
Loading
Disabled
Loading
Square
Loading
Size
Loading
Indicator
Loading
Icon
Loading
Button
Loading
Advanced Label
Loading
Form
Loading
API Reference
This component is built using Radix UI Switch primitives. For detailed information, please visit the full API reference.
Switch
This component is based on the Switch.Root primitive and includes the following custom props:
Prop | Type | Default |
---|---|---|
shape | ||
size | ||
thumbClassName |
SwitchWrapper
This is a custom component that provides context for permanent state and layout.
Prop | Type | Default |
---|---|---|
permanent | ||
className |
SwitchIndicator
This is a custom component that provides visual indicators for the switch states.
Prop | Type | Default |
---|---|---|
state | ||
className |