ChipGroup
ChipGroup — filter chips that toggle together: the twin of genesis-ui-native's NativeChipGroup, with the same `mode` (default `multiple`), `value` and `onChange`; `onChange` gets a string in `single` mode and a list in `multiple`. It is Radix's ToggleGroup, as genesis-ui's ToggleGroup is: one tab stop, the arrow keys move between chips, Enter and Space toggle. Each `ChipGroupItem` draws the resource workspace's Chip, ringed while it is on.
packages/ui/src/components/resource/chip-group.tsx
@marktiderman/genesis-uiimport { ChipGroup } from "@marktiderman/genesis-ui";react-docgen-typescript.ChipGroup
ChipGroup — filter chips that toggle together: the twin of genesis-ui-native's NativeChipGroup, with the same `mode` (default `multiple`), `value` and `onChange`; `onChange` gets a string in `single` mode and a list in `multiple`. It is Radix's ToggleGroup, as genesis-ui's ToggleGroup is: one tab stop, the arrow keys move between chips, Enter and Space toggle. Each `ChipGroupItem` draws the resource workspace's Chip, ringed while it is on.
| Prop | Type | Default | Description |
|---|---|---|---|
| onChange* | ((value: string[]) => void) | ((value: string) => void) | — | |
| value* | string | readonly string[] | — | |
| allowEmpty | boolean | — | Pressing the chosen chip clears it (`onChange("")`). Default false: one stays chosen. |
| aria-label | string | — | What the chips choose, for screen readers ("Filter by level"). |
| className | string | — | |
| disabled | boolean | — | |
| mode | enum | — | |
| testID | string | — |
ChipGroupItem
One chip of a ChipGroup: the group's toggle item, drawn as the Chip.
| Prop | Type | Default | Description |
|---|---|---|---|
| value* | string | — | |
| className | string | — | |
| icon | ReactNode | — | |
| testID | string | — |