Switch
A setting that takes effect the moment it flips, on or off, with nothing to save.
Examples
Variants
- Northgate Credit 13F
- Elm Street Value Form D
States
Usage
Use it when
- You turn a setting on or off and it applies at once: notifications, sounds, a theme, sharing.
- A row in a settings list holds one such setting, the word first and the switch at the end.
Use something else when
- The change applies only when the form is saved. Use Checkbox instead.
- Exactly one of a few options may be chosen. Use SegmentedControl instead.
- The on state is a filter in a row of chips, or a button that stays pressed. Use Pill or Toggle instead.
Rules
General
Content
Avoid
Install
npx shadcn@latest add https://kaanarici.com/r/cobalt/switch.jsonimport { Switch } from "@/components/cobalt/ui/switch"