Skip to content
LyEve UI v0.60.1

Form controls

Toggle

A switch for binary settings: feature flags, notification preferences, dark mode. Built on a role="switch" button, so screen readers announce state changes correctly.

Basic

Sizes

The switch is drawn small and takes an invisible 44px target under a touch screen. Stacked switch rows therefore sit 24px apart there, or each target overlaps the row below and a tap meant for one flips the next. A mouse needs only the 12px gap.

Disabled

API

PropTypeDefaultDescription
checked booleanfalseBindable on/off state.
label string no defaultInline label.
hint string no defaultSubdued hint below the label.
size 'sm' | 'md''md'Switch size.
disabled booleanfalseDisable the toggle.
onchange (checked: boolean) => void no defaultFires when the user flips the switch.
class string no defaultExtra classes, appended to the component's own.
id string no defaultLets a Label outside the component point at the switch.
noAI booleanfalseKeep the value from an assistant: a FormAssist never reports it or fills it, and the control is marked data-no-ai for a browser agent.
name string no defaultPosts on under this name while the switch is on, as a checkbox does.