Skip to content

Switch

Props

API reference for Switch. For usage examples, see the React tab.

NameTypeDefault
children (required)ReactNode

The label of the switch.

defaultSelectedboolean

Whether the element should be selected (uncontrolled).

descriptionstring

Helper text for the switch.

inputRefRefObject<HTMLInputElement>

React 19 only

isDisabledboolean

Whether the input is disabled.

isInvalidboolean

Whether the input value is invalid.

isReadOnlyboolean

Whether the input can be selected but not changed by the user.

isRequiredboolean

Whether user input is required on the input before form submission.

isSelectedboolean

Whether the element should be selected (controlled).

labelPosition"left" | "right" | "top" | null