Chip
Chips display selections, filter criteria or user-entered values. Unlike a badge, a chip is interactive: it can be selected, removed or change the content it filters, and it is usually shown in a group.
@mantine/core@mantine/core also exports a component called Chip. It is a different component with a
different API.
Import Chip from @multiconsult-group-products/design-system.
Usage
Use Chips when users need to choose between options, such as filtering content, selecting categories or setting preferences. Chips work well in groups where users can make single or multiple selections.
<Chip variant="monocrom" size="md" selected={selected} onSelectedChange={setSelected} removeLabel="Fjern Oslo">Oslo</Chip>
Only the height changes across the size scale. The chip is always fully rounded.
Variants
| Variant | When to use |
|---|---|
monocrom | The default, and the first choice for filters. The selected chip stands out clearly from the rest. |
blue | An alternative to monocrom for filters, using the accent color for the selected state. |
neutral | Use when selections should have a subtle appearance without drawing unnecessary attention. |
Props
| Property | Type | Allowed values | Default | Description |
|---|---|---|---|---|
children* | ReactNode | — | — | The chip label. |
variant | ChipVariant | monocrom · neutral · blue | monocrom | Controls the chip's visual treatment. |
size | ChipSize | sm · md · lg | md | Sets the chip height — 24, 32 or 40px. Font size is constant across the scale. |
selected | boolean | — | false | Marks the chip as chosen. |
onSelectedChange | (selected: boolean) => void | — | — | Called with the next selected value when the chip is activated. |
withRemoveButton | boolean | — | false | Shows the trailing remove button. |
onRemove | () => void | — | — | Called when the remove button is activated. |
removeLabel | string | — | Fjern | Accessible name of the remove button. |
* Required
Accessibility
The chip and its remove button are two separate buttons. The chip announces its selected state as pressed or not pressed.
Always set removeLabel to name the value being removed — "Fjern Oslo", not the
default "Fjern". See Accessibility.