Switch
Beta notice: This page is being built.Edit on GitHub(opens in new tab)
Edits an on/off setting using one controlled change handler.
longlink docs component "Switch"
Example
Properties
| Switch - Properties |
|---|
label Label text for the switch (always rendered for accessibility).string |
description Description text displayed below the label.string |
name Includes the themed control's value under this form submission name.string |
required Requires a value before native form submission.boolean |
disabled Prevents interaction and excludes the field from submission.boolean |
value Whether the switch is on or off.boolean |
defaultChecked Initial checked state.boolean |
onChange Callback fired when the switch state changes.(value: boolean) => void |