Toggle
Toggle(
props):Element
An on-and-off switch, filled in the menu’s accent while on.
Parameters
Section titled “Parameters”| 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. |
Returns
Section titled “Returns”Element