Usage
import { RadioGroup } from 'nr1'
Examples
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.
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.
)
false
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.
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.
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.