RadioInput
A single radio button. It has no text label of its own — when you need one, wrap it in FieldLayout.
Basic usage
The checked state uses the checked / defaultChecked / onChange channels; the first argument of onChange is the new checked boolean. Note that a radio cannot be un-checked by clicking it again — clearing an exclusive group needs an extra mechanism (such as a "clear" button that resets the state).
Same-name exclusivity and the form submission value
Give several RadioInputs the same name and the browser's native mechanism guarantees group exclusivity with at most one item submitted with the form. value is the form submission value (written to the native <input>'s value attribute, defaulting to an empty string). It does not affect the checked state.
Using it with FieldLayout
The field's text label is usually delegated to FieldLayout. It automatically associates the label with this radio's native <input> (clicking the label selects it); to specify the association target manually, give the input element's id via inputId.
Disabled
disabled outputs aria-disabled and disables the native <input>, so the radio can no longer be selected. Inside a native <fieldset> such as FieldsetLayout, the group-level disable propagates to it.
API
title, dir and tabIndex are taken over by the component and land on the inner <input>; the component ref points to the outer <span>.
See also
- Where the checked channel sits among the three value channels: Controlled and uncontrolled
- Layout for a labeled field: FieldLayout
- The radio group (exclusive items in one group, arrow keys select directly): RadioSelect