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
checkedboolean—Controlled checked state
onCheckedChange(checked: boolean) => void—Called with the new boolean value when toggled
disabledbooleanfalsePrevents toggling and dims the control
classNamestring—Additional CSS classes on the button element
Base component → Toggleswww.pepulux.com

Notes and documentation

Space for notes, documentation, and best practices for using these components.

Instant on / off

Use a switch for settings that apply immediately. If the change needs a Save step, use a checkbox instead.