Skip to main content

SwitchProps

Props of Switch

See​

ShadCN Switch — the base component

Properties​

checked​

checked: boolean

Stores the current state of the switch. Managed by the parent component.


disabled?​

optional disabled: boolean

Disables the toggle, making it inactive.


label​

label: string

Text displayed to the right of the toggle.


onCheckedChange()?​

optional onCheckedChange: (v) => void

Universal change handler

Parameters​

v​

boolean

Returns​

void


readOnly?​

optional readOnly: boolean

Makes the switch read-only.