Switch
An on/off control for a setting, with an optional label and description row and form submission.
Paste this into your agent.
Switch fits on/off preferences and feature flags, the kind found on settings pages. People read it as a setting to change, and it fits a row with a label and description beside it.
Install
bashnpx shadcn@4.18.0 add @siteplane/switch
Import it from @/siteplane/components/switch. The project needs Siteplane UI's one-time setup first: .
When to pick it
- vs : Pick Checkbox for consent, agreements or options that only matter on submit.
- vs : Pick Toggle for a pressed tool button in an editor or toolbar.
- vs : Pick Settings List for a full page of setting rows, each holding a Switch or another control.
Rules
- Inside a Field, place
FieldLabelandFieldDescriptionbefore the Switch so both describe it. - Use
checkedandonCheckedChangewhen the app saves the setting on change. Otherwise usedefaultChecked. - Set
uncheckedValueif the form must send a value while it is off. - Switch has no indeterminate mode, so keep it away from mixed or partial states.
- For card rows, use
Label variant="card"instead of restyling the switch.
Reference
Add to your agent
Print this skill from the terminal, or connect the whole catalog over MCP. Setup guides
CLI
MCP server
Questions
Related skills
Form Field Validation Timingby UI Skillbook
Validate at the right moment — not on every keystroke, not only on submit.
Forms
Siteplane Attachmentby UI Skillbook
A card for a file or image attached to a message or draft, with upload states and actions.
Siteplane UI
Siteplane Autocompleteby UI Skillbook
A text input that suggests completions while still accepting whatever the person types.
Siteplane UI
Siteplane Calendarby UI Skillbook
An inline month grid for picking a single date, several dates or a range, with unavailable-day rules.
Siteplane UI