---
title: "radio"
image: "https://adonia.pages.dev/og.png"
version: "next"
---

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

# radio

<!-- Generated by `pnpm docs:fields` from packages/core/src/schema/fields/radio.ts. Edit the TSDoc, not this file. -->

Exclusive radio group bound to a scalar attribute — a `select` whose
options are all visible at once, so it carries the same §11.1 enum
mapping and differs only in layout.

| | |
| --- | --- |
| Builder | `F.radio(attribute: string): Radio` |
| Wire type key | `radio` |
| Class chain | `Radio` → `ChoiceField` → `Field` |
| Detail projection | `text-entry` |
| Column counterpart | `text` cell, i.e. `C.text(attribute)` |

::: tip The projection is a per-instance decision
`badge-entry` for a coloured option set, `text-entry` otherwise (protocol §8).
:::

## Example

```ts
import { F } from '@adonia/core'

F.radio('visibility')
  .options({ public: 'Public', private: 'Private' })
  .inline()
  .required()
```

## Props

Beyond the shared [field DSL](/reference/fields#the-shared-field-dsl):

| Prop | Declared on | Behaviour |
| --- | --- | --- |
| `inline(): this` | `Radio` | Lays the options out on one row instead of stacking them. |
| `options(input: OptionsInput): this` | `ChoiceField` | Declares the static option list (§7.3 `options()`). |

### Introspection

Read-only members this type adds — used by the compiler, the table derivation and
tests rather than by a schema author.

| Member | Declared on | Behaviour |
| --- | --- | --- |
| `get declaredOptions(): readonly FieldOption[]` | `ChoiceField` | The declared static options, in declaration order. |
| `get optionValues(): ChoiceValue[]` | `ChoiceField` | The declared option values — the §11.1 enum members. |
| `get hasColoredOptions(): boolean` | `ChoiceField` | Whether any declared option carries a colour. The single input to the `badge-entry`/`badge` projection decision (protocol §8, §7.5). |
| `get displayType(): string` | `ChoiceField` | `badge-entry` for a coloured option set, `text-entry` otherwise (protocol §8). |
| `get columnType(): string \| undefined` | `ChoiceField` | `badge` cell for a coloured option set, `text` otherwise (§7.5). |
| `detailProps(): JsonObject` | `ChoiceField` | Chrome plus the value→presentation maps the chosen entry needs (protocol §8). |

## Validation

Vine base: `vine.string()`, `vine.enum(this.optionValues)`.

§11.1 mapping: `vine.enum(options)`.

Contributed by `Radio.vineSchema()` in `packages/core/src/schema/fields/radio.ts`. The shared modifiers (`required`, `nullable`, `requiredWhen`, `unique`, optionality) are applied on top by `Field.buildValidation`, and a `rules()` override replaces the base entirely — the validator compiler never branches on the field class.

## Declared in

- `packages/core/src/schema/fields/radio.ts` — `Radio`
- `packages/core/src/schema/fields/choice.ts` — `ChoiceField`

Source: https://adonia.pages.dev/reference/fields/radio/index.mdx
