Switch

Binary toggle control with animated thumb. Fully accessible via keyboard and ARIA role='switch'.

import{ Switch } from "@pepulux/ui"

States — off / on / disabled

Uncontrolled switches for showing each visual state side-by-side.

Off
On
Disabled off
Disabled on

Controlled — with label

Drive checked state from React state. Toggle updates the label text.

Enabled

Settings form — multiple switches

Real-world pattern: notification preference toggles with labels and descriptions.

Email alerts

Receive email notifications

SMS alerts

Receive SMS text messages

Push notifications

Receive browser push alerts

Props

PropTypeDefaultDescription
checkedbooleanControlled checked state
onCheckedChange(checked: boolean) => voidCalled with the new boolean value when toggled
disabledbooleanfalsePrevents toggling and dims the control
classNamestringAdditional CSS classes on the button element