Overview Button Copy button Field Input Number field Textarea Select Combobox Multiselect Date picker Date range picker Date-time picker Checkbox Radio group Position picker Switch Slider Dropzone Device controls Avatar Badge Card Collapsible Kbd Map Matrix Proportion bar Separator Stat Table Timeline Chat Playback Pagination Charts Chart theming Profile chart Time series chart Bar chart Isopleth chart TS diagram Box plot Rose chart Calendar chart Banner Toast Loader Progress Skeleton Empty state Error state Dropdown menu Tooltip Info tooltip Dialog Sheet Resizable Confirm dialog Breadcrumbs Command palette Mobile menu Navigation list Outline Scroll rail Sidebar Tabs
Switch
On or off, and it takes effect at once: no Save. Off, a soft grey track and a white thumb; on, it fills with the primary.
Playground
Size
<Switch bind:checked={notify} aria-label="Email me" /> In a row
Label on the left, switch on the right, so a column of them lines up.
Rules
- Only for things that apply at once. Inside a form with a Save button, use a Checkbox.
- The label says what's on, not what the switch does: "Email me", not "Turn on email".
- sm only in dense places: table rows, toolbars.