Search components
Find a component by name
Switch
On/off toggle switch.
Description
Use a horizontal Field with FieldContent and FieldDescription to add helper text next to the switch.
Choice Card
A card-style setting with the same look as RadioGroupItemBoxed and CheckboxBoxed: a Label wraps the text and the Switch, so the whole card toggles it, and it turns primary-subtle with a primary-border when on. There is no boxed switch component; copy the classes from the code.
Disabled
Add the disabled prop to the Switch to disable it, and data-disabled to the Field to dim its label.
Invalid
Add data-invalid to the Field to turn its label destructive, and aria-invalid to the Switch for assistive tech. Refer's Switch has no invalid styling of its own yet.
Size
Use the size prop ("default" or "sm") to change the size of the switch.
Installation
npx shadcn@latest add @refer/switchVariations
Ported from shadcn's examples. Open Code on any section to see and copy it.
Usage in the apps
Which apps install this component, whether their copy matches the registry, and which files import it.
Imported by 10 files across the apps. From olympus-backend@2ee40d05e, Oct 26, 2026. โIn syncโ means the app's copy matches this registry; refresh with npm run usage:build.