---
title: "RadioGroup"
description: "Pick one; v:cards (icons/images, hints), v:segmented toggle bar."
---

> Documentation Index
> Fetch the complete documentation index at: https://gistui.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# RadioGroup

```gistui
root = Form("plan", RadioGroup("plan", "Plan", ["Starter", "Team", "Enterprise"], hints:["For side projects", "Most teams start here", "Self-hosting and SLA"], icons:["user", "users", "building"], v:cards, cols:3, value:"Team"), RadioGroup("billing", "Billing", ["Monthly", "Yearly"], v:segmented, value:"Yearly"))
```

## Signature

This is the line a model reads in the system prompt.

```gistui
RadioGroup(name, label, options:[str], hints:[str], icons:[str], images:[str], cols:num, value:str, v:list|cards|segmented, dir:Dir, error:str, bind:$var, size:Size, hint:str, required)
```

- **Group:** Forms
- **Children:** No
- **Positional arguments:** `name`, `label`, `options` (a trailing `?` means it may be left out)

## Props

| Prop | Type | How to write it | Notes |
|---|---|---|---|
| `name` | string | positional, required |  |
| `label` | string | positional, required |  |
| `options` | list of string | positional, required |  |
| `hints` | list of string | named: `hints:…` | one line per option |
| `icons` | list of string | named: `icons:…` | icon per option (cards) |
| `images` | list of string | named: `images:…` | image URL per option (cards) |
| `cols` | number | named: `cols:…` | card columns |
| `value` | string | named: `value:…` | initially selected option |
| `v` | `list` · `cards` · `segmented` | named: `v:…` | Default `"list"`. |
| `dir` | `col` · `row` | named: `dir:…` |  |
| `error` | string | named: `error:…` |  |
| `bind` | `$state` variable | `bind:$name` | two-way binding to a $variable |
| `size` | `sm` · `md` · `lg` | named: `size:…` | Also accepts `small`, `medium`, `large`. |
| `hint` | string | named: `hint:…` |  |
| `required` | flag | bare word: `required` |  |

## Use your own component

Keep the name and schema, swap what is drawn. The prompt and the model's output do not change.

### React

```tsx
import { ui } from "@gistui/react/ui";

const lib = ui.extend({ RadioGroup: MyRadioGroup });
<GistUI library={lib} stream={response.body} />;
```
### Vue

```vue
<GistUI :source="answer" :components="{ RadioGroup: MyRadioGroup }" />
```
### Svelte

```svelte
<GistUI source={answer} components={{ RadioGroup: MyRadioGroup }} />
```
### Solid

```tsx
<GistUI source={answer()} components={{ RadioGroup: MyRadioGroup }} />
```
### Vanilla

```ts
import { ui } from "@gistui/vanilla/ui";

const lib = ui.extend({ RadioGroup: (ctx) => ({ el: myElement(ctx) }) });
```

See [Custom components](/docs/guides/custom-components/) for the full contract. Style hook: `[data-gistui="RadioGroup"]`.

Source: https://gistui.com/docs/components/forms/radio-group/index.mdx
