Components / Choice
ChipGroup
A wrapping group of toggle chips: single or multi-select, with an optional empty state.
@ruckc/truss-ui Choice
Import
import { ChipGroup } from '@ruckc/truss-ui'; Playground
allowEmpty
value
size
API
| Prop | Type | Default | Description |
|---|---|---|---|
options required | ({ value: string; label: string; icon?: IconSource; disabled?: boolean })[] | — | The choices to offer. |
multiple | boolean | false | Several chips can be pressed at once; `value` is then a `string[]`. |
value bindable | string | string[] | undefined | — | `string[]` when `multiple`, otherwise the pressed value or `undefined`. |
allowEmpty | boolean | — | Whether the last pressed chip can be released. Defaults to `true` when `multiple`, `false` otherwise. |
label | string | 'Options' | Accessible name of the group. |
size | 'sm' | 'md' | 'md' | Control size: `sm` (24px), `md` (32px, default) or `lg` (40px). |
intent | Intent | 'primary' | Semantic colour: `primary`, `neutral`, `success`, `warning` or `danger`. |
check | boolean | false | Show a check mark on pressed chips. |
onchange event | (value: string | string[] | undefined) => void | — | Called when the value changes. |