Radio field
Let authors choose one option from a visible list of radio buttons.
Use field.Radio for a small set of mutually exclusive choices that authors should see without
opening a dropdown. It stores one configured string value, just like
Select.
In the admin

Labels remain interface copy; the document stores one configured option value.
Add radio buttons
field.Radio("priority", "low", "normal", "high").Default("normal")Strings receive generated labels. Use .Options(...) to replace the list with typed options
when the text shown to authors should differ from the stored value:
field.Radio("attendance").Options(
field.Option{Value: "remote", Label: "Join online"},
field.Option{Value: "venue", Label: "Attend at the venue"},
).Required()Radio supports a string Default, Required, localization, indexing/uniqueness, conditions, and
common presentation options. Its value is always one string; use MultiSelect
for multiple values.
Queries and generated types use stored values, never labels. Option labels may be translated
for the admin without localizing the content value. Add .Localized() only when different
locales may select different business values.
Configuration
| Constructor or method | What it controls |
|---|---|
field.Radio(name, values...) |
Creates one stored string choice with labels inferred from the values. |
.Options(options...) |
Replaces the options with field.Option values and explicit labels/translations. |
.Required() |
Requires one configured choice. |
.Default(value) / .DefaultFrom(callback) |
Selects a fixed or request-aware initial choice. |
.Localized() |
Stores a separate selected value for each content locale. |
.Unique() / .Index() |
Enforces distinct values or adds a query index. |
.Validate(...), .LiveValidate(...), .Access(...), .Hooks(...) |
Adds application checks, authorization, and lifecycle behavior. |
Common mistakes
- Too many radio choices create a slow form. Switch to Select or a Relationship picker as the set grows.
- Renaming
Option.Valueis a data migration. ChangingLabelis safe presentation copy. Admin.VisibleWhencan improve the form but cannot enforce a cross-field rule or access policy.
See field.Radio and Select for more choice options.