• /
  • Log in


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.

Note: Setting value will override defaultValue as it puts the RadioGroup into a controlled state. value will not override Radio components that have checked set, as RadioGroup will take control of uncontrolled Radio components and can't override controlled ones.

The onChange event handler for RadioGroup will fire after any onChange event handler set on individual Radio components. However, it is highly recommended to only set one event handler for the whole group in a controlled RadioGroup.


import { RadioGroup } from 'nr1'




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.


Message with instructions on how to fill the form field.


Additional information can be displayed in an info tooltip next to the Label.


When true, sets the field in an invalid state, in order to notify the user attention is needed over this particular field. This property can be a boolean field or a string. When it is a string, as well as the invalid state being shown, the text will be shown below.


Text to display as label.


Display the label inline the form control.

Use only when the component is not inside a Form. In that case set layoutType to Form.LAYOUT_TYPE.SPLIT in the Form component.


Callback which is fired when the radio group value changes (a <Radio> in the group is selected).

function (
event: react.ChangeEvent, //

Event source of the callback.

value: any //

The value of the selected radio button.


If true, denotes the form field as required.


Inline style for custom styling.


Adds a data-test-id attribute.

Use it to target the component in unit and e2e tests.


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.

Create issueEdit page
Copyright © 2021 New Relic Inc.