• Log inStart now

RadioGroup

Usage

import { RadioGroup } from 'nr1'

Examples

Props

childrennode

Content of the RadioGroup.

classNamestring

Appends class names to the component.

descriptionstring

Message with instructions on how to fill the form field.

infostring

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

invalidboolean|string

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.

labelstring

Text to display as label.

labelInlineboolean

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.

onChangefunction

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.

)
requiredboolean
DEFAULT
false

If true, denotes the form field as required.

styleobject

Inline style for custom styling.

testIdstring

Adds a data-test-id attribute. Use it to target the component in unit and E2E tests.

For a test id to be valid, prefix it with your nerdpack id, followed up by a dot.

For example, my-nerdpack.some-element.

Note: You might not see data-test-id attributes as they are removed from the DOM, to debug them pass a e2e-test query parameter to the URL.

valueany

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.

Copyright © 2022 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.