# Radio Group

> The everyday radio group: a hairline ring that fills with primary and a dot that springs in, labels with descriptions, vertical or horizontal layout, three sizes, disabled options and an error state under a fieldset legend. Also exports RadioList, bordered rows with a right-aligned price and a tinted selected row. Built on Base UI, arrow keys included.

- Slug: `radio-group`
- Category: [Toggles](https://www.assembli.design/category/toggles.md)
- Type: component
- Tags: radio, radio-group, form, fieldset, list, shadcn, base-ui
- npm dependencies: @base-ui/react, lucide-react
- shadcn/ui dependencies: none
- Live preview: https://www.assembli.design/preview/radio-group
- Page: https://www.assembli.design/components/radio-group

![Radio Group preview](https://www.assembli.design/thumbnails/radio-group-light.png)

## Props

Other props pass through to the root element.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `legend` | `React.ReactNode` |  | The group's visible name, rendered as the fieldset legend. |
| `description` | `React.ReactNode` |  | A quieter line under the legend. |
| `error` | `React.ReactNode` |  | Marks every radio invalid and shows this message under the group. |
| `size` | `Size` |  |  |
| `className` | `string` |  |  |
| `children` | `React.ReactNode` |  |  |
| `orientation` | `"vertical" \| "horizontal"` | `"vertical"` | Stack the options (default) or lay them out in a wrapping row. |

## Install

One-time setup (needs a subscription):

1. Add the registry to the project's `components.json`: `{"@assembli":{"url":"https://www.assembli.design/r/{name}.json","headers":{"Authorization":"Bearer ${ASSEMBLI_API_KEY}"}}}` (merge into `"registries"`).
2. Put an API key from https://www.assembli.design/account in `.env.local` as `ASSEMBLI_API_KEY=asm_…`.

Then install with the shadcn CLI (writes `components/radio-group/radio-group.tsx` and installs dependencies):

```bash
npx shadcn@latest add @assembli/radio-group
```

Registry item JSON: https://www.assembli.design/r/radio-group.json (send `Authorization: Bearer <api key>`)

## Code

> Component source needs an Assembli subscription ($12/month or $96/year) and an API key sent as `Authorization: Bearer <key>`. To get one without copying anything, POST https://www.assembli.design/api/agent/login (or call the MCP tool connect_account), show the user the link it returns, and poll https://www.assembli.design/api/agent/token for the key. Or subscribe at https://www.assembli.design/pricing and create a key at https://www.assembli.design/account.
