> For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt.

# Radio Group

A list of options where tapping one selects it and clears the others.


## Installation

```bash
npx @blotch/dolan add radio-group
```

```typescript
import { UiRadioGroup, UiRadioGroupItem } from '../components/ui/radio-group';
```

## Usage

```typescript title="src/app/app.ts"
import { Component, signal } from '@angular/core';
import { UiRadioGroup, UiRadioGroupItem } from '../components/ui/radio-group';

@Component({
  selector: 'app-root',
  imports: [UiRadioGroup, UiRadioGroupItem],
  template: `
    <ui-radio-group [(value)]="plan">
      <ui-radio-group-item value="free">Free</ui-radio-group-item>
      <ui-radio-group-item value="pro">Pro, $9 a month</ui-radio-group-item>
    </ui-radio-group>
  `,
})
export class App {
  protected readonly plan = signal('free');
}
```

- Each item shows a circle and its label. Tapping anywhere on the row selects it.
- Items wrap their content in `<text>`, so pass plain text.
- Once an option is selected, tapping it again keeps it selected. Start with `''` for no selection.

### Disabled

```angular-html
<ui-radio-group value="us" disabled>
  <ui-radio-group-item value="us">United States</ui-radio-group-item>
  <ui-radio-group-item value="eu">Europe</ui-radio-group-item>
</ui-radio-group>
```

Disabling the group dims every item and ignores taps. There's no per-item `disabled`.

### Forms

`value` is a `model()`, so it works with every Angular forms API:

```angular-html
<ui-radio-group [formField]="profile.field" />
<ui-radio-group [formControl]="control" />
<ui-radio-group [(ngModel)]="value" />
```

Choosing an item marks the field touched. `UiRadioGroup` implements Signal Forms' `FormValueControl`. See [Forms](/guide/forms.md).

## API

### UiRadioGroup

| Input      | Type      | Default | Description                                      |
| ---------- | --------- | ------- | ------------------------------------------------ |
| `value`    | `string`  | `''`    | The selected item's value. Supports `[(value)]`. |
| `disabled` | `boolean` | `false` | Dims every item and ignores taps.                |
| `class`    | `string`  | `''`    | Extra Tailwind classes for the column of items.  |

| Output        | Type     | Description                                                           |
| ------------- | -------- | --------------------------------------------------------------------- |
| `changed`     | `string` | Emits the value of the item the user tapped.                          |
| `valueChange` | `string` | Emits the new value, for `[(value)]`.                                 |
| `touch`       | `void`   | Emits when an item is chosen, for forms: the field counts as touched. |

### UiRadioGroupItem

| Input   | Type     | Default  | Description                         |
| ------- | -------- | -------- | ----------------------------------- |
| `value` | `string` | Required | The value this item selects.        |
| `class` | `string` | `''`     | Extra Tailwind classes for the row. |

No outputs.

## Related

- [Select](/dolan/select.md): pick one option from a bottom sheet
- [Checkbox](/dolan/checkbox.md): choose several independent options
- [Toggle](/dolan/toggle.md): a single-select toggle group
