Basic
Basic form control usage.
Switch component for Vellira applications.
Import the component and configure it with the same props used in the playground.
Common patterns and practical usage examples.
Basic form control usage.
Disabled state.
Selected state.
Required form control.
Props available for the React Switch.
| Prop | Type | Default | Description |
|---|---|---|---|
accessibilityLabel | string | - | Accessible name announced by assistive technology. |
checked | boolean | - | Controlled checked state. |
defaultChecked | boolean | - | Initial checked state for uncontrolled usage. |
disabled | boolean | - | Disables interaction. |
required | boolean | - | Marks the control as required. |
invalid | boolean | - | Marks the control as invalid. |
onCheckedChange | ( | - | Called when the checked state changes. |
Guidance for accessible usage and interaction.
checkeddisabledrequired