Lucent UI
RadioToggleSegmentedControl
✦ LLM-ready

Toggle

atom

On/off switch in three sizes with optional contained card style (border-strong, neutral checked fill) and helperText. Best used for immediate boolean settings like dark mode, notifications, or feature flags. The align prop positions the track on the left or right.

"Add a Toggle from lucent-ui for a dark mode setting. Make it controlled and update a theme state when toggled."

Usage

React / JSX
import { Toggle } from 'lucent-ui'

<Toggle label="Toggle" size="md" align="left" />

Installation

pnpm add lucent-ui

API Reference

Toggle props — * required

PropTypeDefaultDescription
labelstringText label next to the toggle.
checkedbooleanControlled on/off state.
defaultCheckedbooleanUncontrolled initial state.
size"sm" | "md" | "lg""md"Toggle size.
containedbooleanfalseWraps the toggle in a border-strong container. Checked fills with neutral color-mix(textPrimary 6%) background; unchecked is transparent.
helperTextstringSecondary text displayed below the label.
align"left" | "right""left"Position of the toggle track relative to the label.
disabledbooleanfalsePrevents interaction.
onChange(e: React.ChangeEvent<HTMLInputElement>) => voidChange handler.