UI Siêu Ngon

Switch

Toggle control for on/off states. Built on a native checkbox for accessibility.

Playground
label
size
checked
Label pos
disabled
rounded
<Switch/>

Basic

Label Position

Label can be placed on either side of the track.

Sizes

Disabled

API

PropertyTypeDefaultDescription
checkedbooleanfalseControlled checked state
onChange(e: ChangeEvent) => voidChange handler
labelReactNodeLabel text next to the switch
labelPosition"left" | "right""right"Label position relative to the track
size"sm" | "md" | "lg""md"Size preset
disabledbooleanfalseDisable the switch