Switch

A toggle switch for boolean settings and preferences.

Preview

Off / On
With Labels
Dark mode
Notifications
Disabled
Disabled
Disabled (on)

Usage

tsx
import { Switch } from "@semajsx/ui/components/switch";

<Switch label="Dark mode" />
<Switch label="Notifications" checked />
<Switch disabled />

Props

PropTypeDefaultDescription
labelstringLabel text
checkedbooleanfalseChecked state
disabledbooleanfalseDisabled state
namestringHTML name attribute