Browse components

Switch

import Switch from "@shpaw415/mui-lite/Switch";

Why use it

Switch toggles a boolean setting immediately (notifications on/off). Prefer Checkbox for multi-select lists; Switch for binary preferences.

Demo

Enabled
Off
Secondary
Disabled

Example

import Switch from "@shpaw415/mui-lite/Switch";
 
<Switch defaultChecked label="Dark mode" onChange={onToggle} />

Props

PropTypeDefault
labelstring
colorpalette
sizesmall
checked / defaultCheckedboolean