v0.1 public beta early access on GitHub
Home / Components / switch

SwitchiOS

iOS-size toggle with spring thumb and haptics.

$ npx lumioui add switch
import { Switch } from "@/components/ui/switch/switch";
Switchswitch.tsx
switch/switch.tsx open

Live preview — the real component, driven by the props below.

Props7
checked boolean Whether the switch is on.
onCheckedChange (checked: boolean) => void Called when the user toggles the switch.
disabled? boolean Disable interaction.
className? string Extra classes for the outer wrapper.
haptic? "selection" | "light" | false Haptic on toggle — default "selection". Set false to disable.
label? string Optional label rendered to the left (SwiftUI Toggle style).
iconOn? React.ReactNode Optional icon rendered inside the thumb when on.
Switch — Settingssettings.tsx
switch/variants/settings.tsx open

iOS-size toggle with spring thumb and haptics.

Switch — Standalonestandalone.tsx
switch/variants/standalone.tsx open

iOS-size toggle with spring thumb and haptics.