# Radio

> Single radio control. Pair with RadioGroup.

Registry name: `radio`. HTML docs: https://ui.anuragroy.dev/component/radio.

## Install

```bash
npx shadcn@latest add https://ui.anuragroy.dev/r/radio.json
```

If the website is down: `npx shadcn@latest add https://raw.githubusercontent.com/anurag-roy/ui.anuragroy.dev/main/public/r/radio.json`.

Registry JSON: https://ui.anuragroy.dev/r/radio.json (GitHub: https://raw.githubusercontent.com/anurag-roy/ui.anuragroy.dev/main/public/r/radio.json).

## Import

Import paths follow the consumer `components.json` aliases. After a default install:

```tsx
import { Radio } from "@/components/ui/radio"
```

## Usage

```tsx
import { Radio } from "@/components/ui/radio"
import { RadioGroup } from "@/components/ui/radio-group"

export function Example() {
  return (
    <RadioGroup defaultValue="a" className="flex flex-col gap-2">
      <label className="flex items-center gap-2 text-sm">
        <Radio value="a" /> Option A
      </label>
      <label className="flex items-center gap-2 text-sm">
        <Radio value="b" /> Option B
      </label>
    </RadioGroup>
  )
}
```

## API

### Radio

Base UI Radio. Requires `value` and a parent `RadioGroup`.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `value` | string | — |  |

## See also

- [HTML page](https://ui.anuragroy.dev/component/radio): Preview and the same docs in the site chrome.
- [Registry item](https://ui.anuragroy.dev/r/radio.json): Source files and dependencies.
- [Catalog](https://ui.anuragroy.dev/component): All components.
- [llms.txt](https://ui.anuragroy.dev/llms.txt): Agent index for this library.
