Forms
Chip
Compact token with optional slots and a remove button. Used by ChipsInput and ChipsSelect.
import { Chip } from "datui";Playground
Design
<Chip mode="primary" removable>Design</Chip>Examples
Modes and states
DesignResearchEngineeringSecondaryDisabledRead-only
Accessibility
- The remove button is a native
<button>namedremoveLabelplus the chip text ("Remove Design"). disabledsetsaria-disabledand hides the remove button;readOnlyhides it too.
API
Chip
Compact token with optional slots and a remove button. Used by ChipsInput and ChipsSelect, also standalone.
| Prop | Type | Default | Description |
|---|---|---|---|
| after | ReactNode | — | |
| before | ReactNode | — | |
| className | string | — | |
| disabled | boolean | false | |
| mode | "primary" | "secondary" | primary | |
| onRemove | ((event: MouseEvent<HTMLButtonElement, MouseEvent>, value: string | number) => void) | — | |
| readOnly | boolean | false | |
| removable | boolean | true | Shows the remove button (hidden anyway while `disabled` or `readOnly`). |
| removeLabel | string | Remove | Accessible label of the remove button; the chip text is appended. |
| value | string | number | — | Passed back to `onRemove`. |