Switch
Overview
The Switch component is used as an alternative for the checkbox component.
Properties
Properties | Description |
---|---|
children | The Children prop allows users to pass other components as a property, enabling users to compose together components. |
checked | The controlled state of the switch. Must be used in conjunction with onCheckedChange. |
onCheckedChange | Event handler called when the state of the switch changes. |
defaultChecked | The state of the switch when it is initially rendered. Use when you do not need to control its state. |
name | The name of the switch. Submitted with its owning form as part of a name/value pair. |
value | The value given as data when submitted with a name. |
invertLabelOrder | Changes the reading order of the text and switch. |
disabled | When true, prevents the user from interacting with the switch. |
Updated 6 months ago