Switch

A toggle switch.

Use Field to compose a label, helper text, and validation message around this control.

Usage

Disabled

Props

PropTypeDefaultDescription
checkedboolean-Whether the switch is checked
defaultCheckedboolean-The default checked state for uncontrolled usage
onCheckedChange(checked: boolean) => void-Callback when the checked state changes
disabledbooleanfalseWhether the switch is disabled
idstring-HTML id attribute for label association