# RadioGroup

> A set of mutually exclusive options.

- Category: [Inputs & forms](https://tarve.dev/docs.md#inputs)
- Import: `import { RadioGroup } from "@tarve/core";`
- Props type: `RadioGroupProps`
- Source: [packages/core/src/controls.ts:85](https://github.com/omarcosr/tarve/blob/main/packages/core/src/controls.ts#L85)

## Usage

```tsx title="RadioGroup.tsx"
import { RadioGroup } from "@tarve/core";

let plan = "pro";

<RadioGroup
  value={plan}
  options={[
    { value: "free", label: "Free" },
    { value: "pro", label: "Pro" },
    { value: "team", label: "Team", disabled: true },
  ]}
  onValueChange={(value) => {
    plan = value;
  }}
/>
```

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `options` (required) | `RadioOption[]` | — |  |
| `value` (required) | `string` | — |  |
| `disabled` | `boolean` | — |  |
| `onValueChange` | `(value: string) => void` | — |  |
| `orientation` | `"horizontal" \| "vertical"` | `"vertical"` |  |

## Common props

Shared by every component (descriptions: https://tarve.dev/docs.md#common-props): `children`, `class`, `className`, `highlight`, `id`, `key`, `motionFrom`, `onHighlight`, `onPaste`, `onPointerLeave`, `onPointerMove`, `onSize`, `onTransitionEnd`, `rovingGroup`, `style`.

## Types

```ts title="RadioOption"
interface RadioOption { value: string; label: string; disabled?: boolean }
```

Previous: [Switch](https://tarve.dev/docs/components/Switch.md) · Next: [Select](https://tarve.dev/docs/components/Select.md)

---

Tarve v0.13.8 · HTML version: https://tarve.dev/docs/components/RadioGroup · Index for agents: https://tarve.dev/llms.txt
