Skip to content
Forms

ToggleCraft

A switch built on a real checkbox. The knob stretches while pressed like a soft bead, then springs across while colour spreads out from under it.

Download
  • React
  • Tailwind CSS v4
  • motion

Props

NameTypeDefaultWhat it does
labelstring—Text next to the switch.
hintstring—Small text under the label.
checkedboolean—On or off (controlled).
defaultCheckedbooleanfalseOn or off at start (uncontrolled).
onChange(checked: boolean) => void—Called with the new state.
accentstring"#a78bfa"Colour of the on state.
classNamestring"w-full max-w-xs"Wrapper look.
...restinput props—name, disabled, required and so on go to the input.