A group of <Radio>
buttons. The <Radio>
buttons may either be direct
children or descendants of the radio group. <Radio>
buttons inside a radio
group must have a unique value
assigned.
Once a radio group is established, selecting any <Radio>
in that group
automatically deselects any currently-selected <Radio>
in the group.
Usage
import { RadioGroup } from 'nr1'
Examples
Basic
ReferenceError: RadioGroup is not defined
Controlled component
Props
Content of the RadioGroup.
Appends class names to the component.
Default value of the radio group. The <Radio>
with the matching
value will be selected.
Useful when you don't want to use a controlled component.
Additional information can be displayed in an info tooltip next to the Label.
Text to display as label.
Callback which is fired when the radio group value changes (a
<Radio>
in the group is selected).
function (event: Event, // Event source of the callback.
value: any // The value of the selected radio button.
) => undefined
Inline style for custom styling.
Adds a data-test-id
.
Used to target the component in unit and e2e testing.
Value of the radio group. The radio button with the matching value will be selected.
If defined, it turns the component into a controlled component.
Methods
RadioGroup.render
function () => undefined