Skip to content
Work in progress. These docs describe Spawnite at launch, and some parts are still being built.

Toggle

Toggle(props): Element

An on-and-off switch, filled in the menu’s accent while on.

Parameter Type Description
props { className?: string; disabled?: boolean; label: string; onChange: (value) => void; value: boolean; } -
props.className? string An override that shows in the diff.
props.disabled? boolean Off: dimmed, and it takes no press.
props.label string The accessible name. The switch draws no label of its own: the layout around it does.
props.onChange (value) => void Called with the other state on a press.
props.value boolean Whether it is on.

Element