Reference Field Reference
fields.radioGroup()
Single-choice radio group, displayed as a tab-style layout. No default-value option today.
Single-choice radio group. Maps to editor { name: 'str-radio-group', type: 'str-radio-group' } — note this is one of the few editors where the wire name and type are the same string. Output is the literal union of options[].value — the same <const O> pattern as fields.select(), but always single-value (no multi mode).
Example
fields.radioGroup({
label: 'Layout',
options: [
{ name: 'Grid', value: 'grid', icon: 'grid' },
{ name: 'List', value: 'list', icon: 'list' },
] as const,
})
// _output: 'grid' | 'list'Options
| Option | Type | Required | Description |
|---|---|---|---|
label | string | Yes | Label shown to editors in Strife Studio. |
options | { name: string; value: string; icon?: string }[] | Yes | The radio choices. |
description | string | No | Not shown in Studio's editor panel. |
searchable | boolean | No | Stored on the template; nothing uses it today. |
filterable | boolean | No | Stored on the template; nothing uses it today. |
protected | boolean | No | Stops the field from being edited or removed in Studio's template designer. No effect in the editor panel. |
propertyName | string | No | Override the stored property name. |
defaultValue | one of options[].value | No | The option shown as chosen while the field has no value. Studio doesn't save it. |
No localizable option.
defaultValue (since @strifeapp/schema 0.15.0) only decides which option Strife Studio shows as chosen while the field has no value. Studio doesn't save it, and clicking the option that already looks chosen does nothing, so the stored value stays empty until an editor picks another option. Treat a missing value as the default in your site.
Output type
O[number]['value'] — the literal union of options[].value.
See also
- Radio Group — the same editor, documented from the Strife Studio UI side.