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

ToggleAndroid

Button-style toggle with pressed state and haptics.

$ npx lumioui add toggle
import { Toggle } from "@/components/ui/toggle/toggle";
Toggletoggle.tsx
toggle/toggle.tsx open

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

Props11
pressed? boolean Controlled pressed/checked state. Omit with defaultPressed for uncontrolled use.
defaultPressed? boolean Initial pressed state (uncontrolled). Default false.
onPressedChange? (pressed: boolean) => void Called when the user toggles.
style? "button" | "switch" Toggle style — "button" renders a pill toggle, "switch" renders an iOS switch.
glass? boolean Liquid-glass pill (button style only).
haptic? "selection" | "light" | false Haptic feedback. Default "selection". Set false to disable.
icon? React.ReactNode Icon rendered before the label (button style only).
textClassName? string Extra classes for the label.
className? string Extra classes for the container.
children? React.ReactNode Optional label text. In switch style, renders to the left of the switch.
disabled? boolean Disable interaction.
Toggle — Buttonbutton.tsx
toggle/variants/button.tsx open

Button-style toggle with pressed state and haptics.

Toggle — Connectivityconnectivity.tsx
toggle/variants/connectivity.tsx open

Button-style toggle with pressed state and haptics.

Toggle — Glassglass.tsx
toggle/variants/glass.tsx open

Button-style toggle with pressed state and haptics.