# Radio (Andromeda Legacy)

Radio is a component of the free, MIT-licensed Andromeda Legacy design system from AI Canvas (https://aicanvas.me). Index of every system, component and install setup: https://aicanvas.me/llms.txt

Mutually-exclusive square radio. Standalone or inside a RadioGroup wiring up name, value, onValueChange.

- Design system: [Andromeda Legacy](https://aicanvas.me/design-systems/andromeda.md)
- License: MIT
- Install slug: `andromeda-radio`
- Page: https://aicanvas.me/design-systems/andromeda/radio

## Install

```bash
npx shadcn@latest add @aicanvas/andromeda-radio
```

Needs a free AI Canvas account; signed out, the command writes a placeholder (an `AccountRequired` notice) instead.

Every Andromeda Legacy component at once: `npx shadcn@latest add @aicanvas/andromeda`.

Token setup: the Install section of https://aicanvas.me/llms.txt.

## Use it

It installs to `components/aicanvas/andromeda/components/Radio.tsx` (under `src/` if your project has one). With the usual `@/` alias:

```tsx
import { Radio } from '@/components/aicanvas/andromeda/components/Radio'
```

## Example

```tsx
import { Radio, RadioGroup } from '@/components/aicanvas/andromeda/components/Radio'

<RadioGroup name="deploy-target" defaultValue="staging">
  <Radio value="staging" label="Staging" />
  <Radio value="production" label="Production" />
</RadioGroup>
```

## Parts

Radio is built from `RadioGroup` and `Radio`. Each part has its own props table below.

## Props

### RadioGroup

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `name?` | `string` |  | Shared group name for the radios' native inputs; auto-generated when omitted. |
| `value?` | `string` |  | Selected value in controlled mode; the matching radio is checked. |
| `defaultValue?` | `string` |  | Initially selected value when uncontrolled. |
| `onValueChange?` | `(next: string) => void` |  | Handler called with the newly selected value. |
| `disabled?` | `boolean` | `false` | Disables every radio in the group. |
| `children?` | `React.ReactNode` |  | Radio elements belonging to the group. |
| `className?` | `string` |  | Extra classes for the group wrapper. |
| `style?` | `React.CSSProperties` |  | Inline styles merged onto the group wrapper. |

### Radio

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `value?` | `string` |  | Required when used inside RadioGroup. |
| `checked?` | `boolean` |  | Standalone controlled state. |
| `defaultChecked?` | `boolean` | `false` | Initial checked state when uncontrolled and standalone. |
| `onCheckedChange?` | `(next: boolean) => void` |  | Handler called with the new checked state when toggled. |
| `label?` | `string` |  | Text label rendered beside the box. |
| `disabled?` | `boolean` |  | Disables the radio and blocks interaction. |
| `className?` | `string` |  | Extra classes merged onto the visual box. |
| `style?` | `React.CSSProperties` |  | Inline styles merged onto the wrapper. |
| `id?` | `string` |  | Id for the input; links the label via htmlFor, auto-generated when omitted. |
| `name?` | `string` |  | Native input name that groups radios; falls back to the group's name. |

## More Andromeda Legacy components

- [Search Field](https://aicanvas.me/design-systems/andromeda/search-field.md)
- [Segmented Control](https://aicanvas.me/design-systems/andromeda/segmented-control.md)
- [Slider](https://aicanvas.me/design-systems/andromeda/slider.md)
- [Spinner](https://aicanvas.me/design-systems/andromeda/spinner.md)
- [Stat Tile](https://aicanvas.me/design-systems/andromeda/stat-tile.md)
