# Radio Group

A set of checkable buttons, known as radio buttons, where no more than one of the buttons can be checked at a time.

Section: Components / Inputs
Page: https://ui.heyramzi.com/components/radio-group
Import path: `@heyramzi/ui/shadcn/radio-group`

## Import

```ts
import * as RadioGroup from "@heyramzi/ui/shadcn/radio-group";
import { Label } from "@heyramzi/ui/shadcn/label";
```

## Usage

```svelte
<RadioGroup.Root value="comfortable">
  <RadioGroup.Item value="default" id="r1" />
  <label for="r1">Default</label>
  <RadioGroup.Item value="comfortable" id="r2" />
  <label for="r2">Comfortable</label>
</RadioGroup.Root>
```

## Demo

```svelte
<script lang="ts">
	import * as RadioGroup from "@heyramzi/ui/shadcn/radio-group";
	import { Label } from "@heyramzi/ui/shadcn/label";
</script>

<RadioGroup.Root value="comfortable">
	<div class="flex items-center space-x-2">
		<RadioGroup.Item value="default" id="r1" />
		<Label for="r1">Default</Label>
	</div>
	<div class="flex items-center space-x-2">
		<RadioGroup.Item value="comfortable" id="r2" />
		<Label for="r2">Comfortable</Label>
	</div>
	<div class="flex items-center space-x-2">
		<RadioGroup.Item value="compact" id="r3" />
		<Label for="r3">Compact</Label>
	</div>
</RadioGroup.Root>
```

## API

### RadioGroup.Root

| Prop | Type | Default | Notes |
| --- | --- | --- | --- |
| `ref` | `HTMLElement \| null` | `null` | bindable |
| `class` | `string` |  |  |
| `value` | `string` | `""` | bindable |

Every prop of `RadioGroup.Root` from `bits-ui`.

### RadioGroup.Item

| Prop | Type | Default | Notes |
| --- | --- | --- | --- |
| `ref` | `HTMLElement \| null` | `null` | bindable |
| `class` | `string` |  |  |

Every prop of `RadioGroup.Item` from `bits-ui`, except `child, children`.
