Forms
Toggle
iOS-style on/off switch in two sizes.
System Switches
Interactive switches for boolean settings. Features smooth spring animations and haptic feedback on touch devices.
Allow notifications
Dark mode
Biometric authentication
Label Positioning
Place labels on the left or right of the switch to match your layout requirements.
Left Positioned Label
Right Positioned (Default)
Visual Scales
Standard and small sizes for different interface densities.
Medium (Default)
Small
Real-world: Focus Mode
A high-fidelity example showing how to use Toggle to control complex UI states.
Enable Focus Mode
Properties
| Prop | Type | Default | Description |
|---|---|---|---|
checked | boolean | — | Controlled Boolean checked state |
defaultChecked | boolean | — | Initial uncontrolled checked state |
onChange | (checked: boolean) => void | — | Callback function triggered when the value changes |
label | string | — | Primary text label description |
labelPosition | 'left' | 'right' | — | Configures the labelPosition option |
disabled | boolean | — | If true, disables all user interaction and applies faded opacity |
size | 'sm' | 'md' | — | Predefined size scaling preset |
options | { label: string | — | Array of option items containing value and label elements |
value | string | — | Raw data string or URL to encode into the QR grid |