• /
  • Log in
  • Free account

CheckboxGroup

Usage

import { CheckboxGroup } from 'nr1'

Examples

Props

childrennode

Content of the CheckboxGroup.

classNamestring

Appends class names to the component.

defaultValuestring[]
DEFAULT
[]
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 checkbox group value changes (a <Checkbox> in the group is selected).

function (
event: React.ChangeEvent,

Event source of the callback.

value: string[]

The values of the selected checkboxes.

)
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.

valuestring[]

Values of the checkbox group. The <Checkbox> components with matching values will be selected.

If defined, it turns the component into a controlled component.

Create issueEdit page
Copyright © 2021 New Relic Inc.