Skip to content

Switch (atom) ​

MUI Switch themed to the Tech Fleet primary. Replaces src/components/ui/switch.tsx.

  • Layer: atom · Status: WRAP · Import: import { Switch } from "@/design-system"

Live demo ​

API ​

Full MUI SwitchProps.

Deviation from stock MUI ​

  • Checked track = primary; unchecked track = divider (theme MuiSwitch). Note: MUI's toggle uses role="switch" on its input (not checkbox) — relevant when querying in tests.

Behavior (→ tests) ​

  • Renders a toggle input, unchecked by default.

Usage ​

tsx
<Switch id="notify" defaultChecked />
<Label htmlFor="notify">Notifications</Label>

Built on MUI Core (MIT). Part of the Tech Fleet Network monorepo.