Theme
Install with your agentnpx shadcn@4.23.1 add https://registry.goop.so/g/<link>/meadow-choice-group.json --yes

Choice group

Pro

A group of choices for a form, a row each, with its label, a description and one error for the whole group, for React and Tailwind CSS. Part of Goop Pro.

Answer two questions by tapping anywhere on a row: studies (at least one) and how often (one). Send with either unanswered is refused under that question; answered, it shows what the form sends. Lay the studies in columns, or turn both questions off. Nothing is sent: Send only reads the form.

When to use

  • A group of choices for a form, a row each, with its label, a description and one error for the whole group.
  • Use it wherever a form asks a question answered by ticking boxes (interests, days, terms) or by picking one of a few described options (a plan); never a Field round a list of checkboxes. The group checks nothing: a "choose at least one" rule is the form's, its sentence handed to error. A few short options in a settings row: a Select in a Field.

Installation

Paste the prompt below into your coding agent. It reads Goop's install steps, installs the part and its tokens once, then reuses this same Choice group on every screen instead of drawing a new one: the same height, the same focus ring, the same spacing. As a Pro part, its command comes from Goop's server once you sign in, with a one-time link that lasts ten minutes.

Terminal
npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/meadow-choice-group.json --yes
PROMPT
Add the Goop Choice group to this project. The install steps are at https://goop.so/docs/install.md

Usage

TSX
import { Checkbox } from '@/components/ui/goop/checkbox';
import { ChoiceGroup, ChoiceGroupItem } from '@/components/ui/goop/choice-group';
import { RadioGroup, RadioGroupItem } from '@/components/ui/goop/radio-group';

function JoinStudies({ tried, studies }: { tried: boolean; studies: string[] }) {
  return (
    <>
      <ChoiceGroup
        label="Which studies would you join?"
        description="Choose at least one"
        error={tried && studies.length === 0 ? 'Choose at least one study.' : undefined}
      >
        <ChoiceGroupItem label="One-to-one interview" description="An hour, on a video call">
          <Checkbox name="studies" value="interview" />
        </ChoiceGroupItem>
        <ChoiceGroupItem label="Diary study" description="Short entries over two weeks">
          <Checkbox name="studies" value="diary" />
        </ChoiceGroupItem>
      </ChoiceGroup>
      <ChoiceGroup label="How would you take part?">
        <RadioGroup name="way" defaultValue="remote">
          <ChoiceGroupItem label="Remote" description="From home, on a video call">
            <RadioGroupItem value="remote" />
          </ChoiceGroupItem>
          <ChoiceGroupItem label="In our studio" description="Travel costs paid">
            <RadioGroupItem value="studio" />
          </ChoiceGroupItem>
        </RadioGroup>
      </ChoiceGroup>
    </>
  );
}
  • Fits: flow (its recipe).
  • Also known as: CheckboxGroup, Fieldset, ChoiceList, CheckboxList.
  • height, width, padding, gap, corner, border, background, text, motion: add no class for these.

API reference

Options
OptionTypeWhat it does
labelReactNodeThe question the choices answer, the group's name (its legend).
description?ReactNodeA line under the label, read with the group ("Choose all that apply").
error?ReactNodeWhat is wrong and how to fix it, once under the rows; it marks every box invalid.
errorId?stringThe error line's id, where the caller needs its own; a generated one otherwise.
disabled?boolean = falseEvery choice off: none takes the focus, a click or a key, and none is sent with the form.
columns?1 | 'auto' = 11, one column; auto, as many columns of 200 px or more as fit, each filled top to bottom.
childrenReactNodeThe rows: ChoiceGroupItems, or one RadioGroup holding them for a choice of exactly one.
Parts
PartWhat it is
ChoiceGroupItemOne choice of a ChoiceGroup; label: ReactNode — The choice's words, which name its box; description?: ReactNode — An optional second line under the words, in the muted ink, read with the box; children: ReactElement<{ className?: string; disabled?: boolean; 'aria-invalid'?: boolean | 'true' | 'false'; 'aria-describedby'?: string; 'aria-label'?: string; 'aria-labelledby'?: string; }> — The row's control: a Checkbox, or a RadioGroupItem inside a RadioGroup; also takes htmlFor?: string
  • data-slot values (to select a part by): choice-group, choice-group-description, choice-group-item, choice-group-item-content, choice-group-item-control, choice-group-item-description, choice-group-item-label, choice-group-label, choice-group-list

Keyboard

KeyWhat it does
TabMove to the next box; in a RadioGroup, to the chosen circle (the first when none is)
SpaceTick or clear the focused box; choose the focused circle
Arrow keysIn a RadioGroup, move the choice to the next or previous circle, wrapping

Accessibility

  • The part itself answers the keys above.
  • hover: the browser's own (:hover): write nothing

Its states are drawn from attributes and props, so assistive technology and your agent read the same thing:

StateDrawn by
disabledthe prop disabled

Motion

  • The part sets its own motion: add no transition or animation of your own.

Notes for AI

Give your coding agent this page as text instead of screenshots: the parts, the options, the states and the keys. An agent that reads the real part builds the real part, not a lookalike.

goop.so/themes/meadow/components/choice-group.md · the page as Markdown
Theme
Install with your agentnpx shadcn@4.23.1 add https://registry.goop.so/g/<link>/meadow-choice-group.json --yes

Where would you like to start?

Free · now

The Goop plugin

A design system for your AI coding agent, so screen ten matches screen one.

/plugin marketplace add goop-so/skillsthen /plugin install goop@goopCodex, Cursor, ChatGPT, the Claude app and more: Connect Goop
FreePro

The components

Every part live, with its props, its keys and what an agent sees. Whole page and app templates, working with sample data.