Switch
Turn a setting on or off.
Examples
Read event.target.checked in onChange. Loading preserves children and prevents interaction. Give the control a text label or aria-label. Native name, value and required properties support form submission.
Live previewInteractive example
basic.tsx
Live previewInteractive example
Email notifications enabled
controlled.tsx
Switch API
Types
Import SwitchProps to describe component props. Option types in the API table link to their detailed fields above.
Forms and localization
Use name to include values in FormData. Uncontrolled fields follow form reset; reset controlled values in application state. Place controls in FormField for labels, help and errors. ConfigProvider supplies regional themes and translated built-in UI. Application labels and options are your responsibility.