Switch

A toggle switch for boolean values, rendered as an accessible button with role="switch".

Installation

npx dafink-ui add switch

Demo

Receive updates about your account.

Props

NameTypeDefaultDescription
checkedboolean-Controlled checked state.
onCheckedChange(checked: boolean) => void-Callback fired when the switch is toggled.
labelstring-Visible label rendered beside the switch.
hintstring-Helper text rendered below the label.
disabledbooleanfalseDisables the switch.
idstringautoHTML id for the switch button; auto-derived from label if omitted.