Some properties provide flexibility for specific integrations. Follow the component's usage guidance. Customizations beyond the documented patterns need a use case approved by DNB UX. Read about intended use and customization.
Properties#
| Type | Description | |
|---|---|---|
text | React.ReactNode | (optional) The visible name of the chip. Takes precedence over children. Use text and decorative content only. |
children | React.ReactNode | (optional) The visible name when text is not provided. |
variant | "default" "addable" "radio" "checkbox" | (optional) Choose the appearance. Chip.Group controls single or multiple selection independently of the appearance. Defaults to default. Addable chips use native toggle buttons with aria-pressed, except in single selection groups, which retain radio inputs. The icon switches between add and remove; the chip stays visible. |
size | "default" "small" "medium" "large" | (optional) The size of the chip. Inherits from Chip.Group. Defaults to default. Small, medium, default, and large have minimum heights of 1.5, 2, 2.5, and 3 rem respectively. |
suffix | React.ReactNode | (optional) Additional guidance or a help button outside the clickable pill. Associated with the control through aria-describedby. |
icon | string React.ReactNode | (optional) Optional decorative icon, flag, or logo before the text. Accepts an Icon name or React element. |
labelSrOnly | boolean | (optional) Hides the name visually while keeping it available to screen readers. Icons and selection indicators remain visible. Use a recognizable icon or indicator and provide a tooltip for the hidden name. |
tooltip | React.ReactNode | (optional) Additional information shown on hover or keyboard focus. Accepts text, React content, or a Tooltip component for configuration. A tooltip that repeats the chip name is not announced twice. |
checked | boolean | (optional) Whether the chip is selected. Defaults to false. User interaction updates the selection, and a changed checked property synchronizes it. Inside Chip.Group, use the group value or values instead. |
value | string number | (optional) The option identifier. Events preserve its string or number type; native form submission uses a string. Defaults to an empty string. Give every option in Chip.Group a unique value, including after conversion to a string. |
disabled | boolean | (optional) Prevents interaction, keyboard focus, and form submission. |
readOnly | boolean | (optional) Prevents selection changes while keeping the chip focusable and included in form submission when selected. Read-only addable buttons expose aria-disabled. |
status | "error" "information" boolean | (optional) Text with a status message. The style defaults to an error message. You can use true to only get the status color, without a message. A color change alone is not enough, so then show the message yourself, for example in a FormStatus or a GlobalStatus. |
statusState | "error" "warning" "information" "success" "marketing" | (optional) Defines the state of the status. Can be error, warning, information, success or marketing. Defaults to error. |
statusProps | FormStatusProps | (optional) Use an object to define additional FormStatus properties. See FormStatus. |
globalStatus | object | (optional) The configuration used for the target GlobalStatus. |
skeleton | boolean | (optional) If set to true, an overlaying skeleton with animation will be shown. |
ref | React.Ref<HTMLInputElement | HTMLButtonElement> | (optional) The native input or, for addable chips outside single selection groups, the button. |
Space | string object | (optional) Spacing properties like top or bottom are supported. |
Native input attributes such as name, required, aria-label, and aria-describedby are supported.
Chip.Group properties#
Chip.Group selects one option by default (selectionMode="single"). Use value for single selection, or selectionMode="multiple" with values for multiple selection. Set a shared variant on the group, and give every nested Chip a unique value.
| Type | Description | |
|---|---|---|
label | React.ReactNode | (optional) Use either the label property or provide a custom one. |
value | string number | (optional) The selected chip value with selectionMode="single" (the default). Must match the value and type of a nested Chip. User interaction updates the selection, and a changed value property synchronizes it. Set it to undefined to clear the selection. |
values | Array<string | number> | (optional) The selected values with selectionMode="multiple". User interaction updates the selection, and a new array synchronizes it. Keep the array in state and update it in onChange, because an inline array replaces the selection on every render. Use an empty array to clear the selection. |
selectionMode | "single" "multiple" | (optional) Select one option using value, or several options using values. Defaults to single. |
variant | "default" "addable" "radio" "checkbox" | (optional) Shared appearance. Each Chip can override it. Defaults to default. |
name | string | (optional) The shared form field name. Set it when the group is part of a form, so the submitted field has a predictable name. A unique name is generated when omitted. |
size | "default" "small" "medium" "large" | (optional) Shared size. Each Chip can override it. Defaults to default. |
disabled | boolean | (optional) Disables the chips in the group. Each Chip can override it. |
readOnly | boolean | (optional) Preserves the selection while keeping the chips focusable and included in form submission. Each Chip can override it. |
skeleton | boolean | (optional) If set to true, an overlaying skeleton with animation will be shown. |
layoutDirection | "column" "row" | (optional) The layout direction of the chips. Defaults to row. |
labelDirection | "vertical" "horizontal" | (optional) To define the label layout direction on how the next element should be placed on. Can be either vertical or horizontal. Defaults to vertical. |
labelSrOnly | boolean | (optional) Use true to make the label only readable by screen readers. |
vertical | boolean | (optional) Places both the label and the chips vertically. |
status | string boolean | (optional) Uses the form-status component to show failure messages. |
statusState | "error" "warning" "information" "success" "marketing" | (optional) Defines the state of the status. Can be error, warning, information, success or marketing. Defaults to error. |
statusProps | Various | (optional) Use an object to define additional FormStatus properties. |
globalStatus | Various | (optional) The configuration used for the target GlobalStatus. |
Space | string object | (optional) Spacing properties like top or bottom are supported. |