Components / Forms & controlsv1.0.0 · updated 2026-09-12
Free · MIT
A real checkbox under the hood, so it works with forms, labels and keyboard focus.
switchcheckbox
Customize
Accent
Install
No dependencies beyond React. Copy the file and import it.
- Copy
Toggle.tsxfrom the Code tab intocomponents/brazen/. - Make sure the Brazen tokens are loaded (
tokens.css); colours and timing come from them. - Import it and pass the props below.
Props 4
| Prop | Type | Default | Description |
|---|---|---|---|
id | string | — | Input id. |
label | string | — | Visible label. |
checked | boolean | — | Controlled value. |
onChange | (checked: boolean) => void | — | Change handler. |
Features
- Native checkbox
- Focus ring
- Disabled state
Dependencies
react@>=19peer
Works with
- React 19
- Next.js 15+
- TypeScript
Reduced motion
Knob moves instantly.