Haedong
007

Switch

Form

Off

Customize

State
Disabled
Label

Code

<Switch>Notifications</Switch>

Install

npx shadcn@latest add https://components.haedong.dev/r/switch.json

Props

Extends the native input props (checked, defaultChecked, onChange, name, …); the input carries role="switch". Renders a <label> around it, so children is the label text.

PropTypeDescription
childrenReactNodeLabel text. Omit for a bare switch and pass aria-label instead.
disabledbooleanNative disabled; dims the item to 40% and drops pointer events.
classNamestringExtra classes for the wrapping label.