RadioButtonField wraps a RadioButtonGroup to provide a legend and a InlineMessageRadioButtonField.Item renders an individual RadioButton with an inline Label.

Note: a RadioButtonField.Item’s value must be a string.

<Form>
  <RadioButtonField name="options" label="Please select an option">
    <RadioButtonField.Item label="Option 1" value="1" />
    <RadioButtonField.Item label="Option 2" value="2" />
  </RadioButtonField>
</Form>

If you need to know when the radio group value changes, you can pass onValueChange, which takes a string type as input.

<RadioButtonField onValueChange={onChangeHandler} />

API Reference

RadioButtonField
PropTypeDefaultRequired
appearance
"standard" | "modern"
--
asJSX.IntrinsicElements--
asChild
boolean
--
defaultValue
string
--
description
string
--
dir
"ltr" | "rtl"
--
direction
"row" | "column"
column-
disabled
boolean
--
error
string
--
hideLabel
boolean
--
labelstring-
loop
boolean
--
namestring--
onValueChange
(value: string) => void
--
orientation
"horizontal" | "vertical"
--
prompt
{ link?: string | undefined; label: string; onClick?: (() => void) | undefined; }
--
required
boolean
--
validation
ValidationOptions
--
value
null | string
--