Skip to content
Design System
GitHub

Choice field

v0.15.1

A choice as a whole tappable row (checkbox, radio or switch with label, description and count); FieldSet groups them under one question.

Status

Show robots in any of these states

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.

When to use

  • Filters with counts.
  • Settings that switch on and off.
  • Several answers to one question in a form.

Use something else

  • A single control with a label and nothing else: Label next to it.
  • Picking one of many: Select.

More examples

States and real uses. Each example is also a Storybook story and a visual regression test.

Notifications

Choice field switches

When the battery is low

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.

How to upgrade