Switch
Switch — Prism component.
Signature
Density
Viewport
Theme follows the navbar ☀/☾ toggleWhen to use
Switch — Prism component.
Accessibility
Exposes role="switch" with aria-checked; toggled with Space. Pair the icon variant with a real label.
Import
const { Switch } = window.PrismDesignSystem_39d121;
Props
| Prop | Type | Required | Description |
|---|---|---|---|
isSelected | boolean | — | |
defaultSelected | boolean | — | |
isDisabled | boolean | — | |
onChange | (isSelected: boolean, e: React.ChangeEvent) => void | — | |
iconOn | React.ReactNode | — | Icon shown on the thumb when ON (e.g. a moon for dark mode). |
iconOff | React.ReactNode | — | Icon shown on the thumb when OFF (e.g. a sun for light mode). |
children | React.ReactNode | — | |
className | string | — |