components / switch

switch.

instant on/off toggle with role="switch", for settings that take effect the moment they move — as opposed to checkbox, which states an intent a submit later commits. square track, square knob.

installation
bunx @justin06lee/chrome@latest add switch
props
nametypedefaultdescription
checked *boolean-
onChange *(checked: boolean) => void-
labelReactNode-text beside the track; clicking it toggles.
descriptionReactNode-second line under the label.
labelPosition'start' | 'end''end''start' puts the label first and pushes the track to the far edge.
size'sm' | 'md''md'
disabledbooleanfalse
ariaLabelstring-accessible name when there is no visible label.
classNamestring-