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
labelstring
Label text for the switch (always rendered for accessibility).
descriptionstring
Description text displayed below the label.
namestring
Includes the themed control's value under this form submission name.
requiredboolean
Requires a value before native form submission.
disabledboolean
Prevents interaction and excludes the field from submission.
valueboolean
Whether the switch is on or off.
defaultCheckedboolean
Initial checked state.
onChange(value: boolean) => void
Callback fired when the switch state changes.