Toggle
Native macOS boolean switch control that responds straight on the desktop — pair with useStorage or useSetting for instant toggles.
Signature#
SIGNATURE
<Toggle
value={enabled}
label="Focus Mode"
color="theme.accent"
onChange={setEnabled}
/>
macOS Switch
Interactive
Props#
Inherits StyleProps:
valuebooleanRequired- Current boolean on/off state.
labelstringOptional- Optional label displayed alongside the switch.
colorstringDefault "theme.accent"- Tint color when switched on.
onChangefunctionOptional- Callback
(next: boolean) => voidfired on toggle.
Example: Multi-Color Switches#
TSX
<VStack spacing={10}>
<Toggle value={lamp} label="Desk Lamp"
color="theme.warning"
onChange={setLamp} />
<Toggle value={rain} label="Rain Audio"
color="theme.accent"
onChange={setRain} />
</VStack>
Multi-Color Switches
Interactive