Theme
Install with your agentnpx shadcn@4.23.1 add @goop/trail-radio-group

Radio group

Free

A named group of options of which exactly one is chosen, for React and Tailwind CSS. Free, MIT.

Pick a plan with the pointer or the arrow keys and save it: the button is busy for a moment, then the current plan changes. The Free plan is refused, with the reason, for a workspace of five members. Look switches a plan chosen, none chosen yet, the Free plan off, or a plan whose words wrap; Orientation lays the plans in a row; Disabled turns the group off. The save is a timer; the five members and the plans are our own sample.

When to use

  • A named group of options of which exactly one is chosen.
  • Also called: radio buttons.

When not to use

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 Radio group on every screen instead of drawing a new one: the same height, the same focus ring, the same spacing.

Terminal
npx shadcn@4.23.1 add @goop/trail-radio-group
PROMPT
Add the Goop Radio group to this project. The install steps are at https://goop.so/docs/install.md

Usage

TSX
import { RadioGroup, RadioGroupItem, RadioGroupLabel } from '@/components/ui/goop/radio-group';

<RadioGroup aria-label="Start the week on" defaultValue="monday">
  <RadioGroupLabel>
    <RadioGroupItem value="monday" /> Monday
  </RadioGroupLabel>
  <RadioGroupLabel>
    <RadioGroupItem value="sunday" /> Sunday
  </RadioGroupLabel>
</RadioGroup>
  • Fits: flow (its recipe).
  • In a form, give the group a Field orientation="vertical" or a heading of its own, never a settings row.
  • height, width, padding, gap, corner, border, background, text, motion: add no class for these.

API reference

Options
OptionTypeWhat it does
value?stringThe chosen option's value, for a group its caller holds (with onValueChange).
defaultValue?stringThe option chosen at first render, for a group that holds its own choice.
onValueChange?(value: string) => voidCalled with the option's value whenever a person chooses one.
name?stringThe group's name, sent with the form; its own when left out.
disabled?boolean = falseEvery option off: none takes the focus, a click or a key.
required?boolean = falseA form with this group cannot be sent until an option is chosen.
orientation?'vertical' | 'horizontal' = 'vertical'The options as a column or a row that wraps.
  • State: value (value / defaultValue / onValueChange); drawn by data-disabled
Parts
PartWhat it is
RadioGroupItemOne option's radio, inside a RadioGroupLabel with its words; value is what the group reports; value: string — The value the group reports and sends when this option is chosen; also takes onChange?: (event: ChangeEvent<HTMLInputElement>) => void; required?: boolean; disabled?: boolean; form?: string
RadioGroupLabelOne option's clickable row; put its RadioGroupItem in it first, then the option's words; also takes htmlFor?: string
  • data-slot values (to select a part by): radio-group, radio-group-item, radio-group-label

Keyboard

KeyWhat it does
ArrowUp ArrowDown ArrowLeft ArrowRightMove selection
SpaceChoose focused

Accessibility

  • The native element answers the keyboard.
  • focus-visible, checked: the browser's own (:focus-visible, :checked): write nothing

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

StateDrawn by
disabledthe attribute data-disabled

Motion

  • The part sets its own motion: add no transition or animation of your own.
  • How the theme moves, and how to move your own parts the same way: Motion.

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/trail/components/radio-group.md · the page as Markdown
Theme
Install with your agentnpx shadcn@4.23.1 add @goop/trail-radio-group

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.