Choice field
v0.15.1A choice as a whole tappable row (checkbox, radio or switch with label, description and count); FieldSet groups them under one question.
Choice field checkboxes
Install
npx shadcn add @syncrobotic/choice-field Also installs: lucide-react, @syncrobotic/cn
Overview
One choice as a whole tappable row: a checkbox, radio or switch with its label, a description and an optional count. FieldSet groups them under one question.
More examples
States and real uses. Each example is also a Storybook story and a visual regression test.
Choice field switches
Choice field radios
Usage rules
- The whole row is the target, at least 44 px: a tap on the label toggles the control.
- Checkboxes and radios at the start; a switch, which acts at once, at the end.
- Group choices under one question with FieldSet and a legend; its hint or error sits under the group.
Changelog
- 0.15.12026-11-21FieldSet keeps its last note in state set during render instead of a ref written during render, so it is safe under the React Compiler. No visible change.
- 0.15.02026-11-19FieldSet takes its column's width, so long legends wrap instead of being cut.
- 0.10.02026-11-18A disabled choice turns muted, not faded.