datui
Color scheme

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> named removeLabel plus the chip text ("Remove Design").
  • disabled sets aria-disabled and hides the remove button; readOnly hides it too.

API

Chip

Compact token with optional slots and a remove button. Used by ChipsInput and ChipsSelect, also standalone.

PropTypeDefaultDescription
afterReactNode—
beforeReactNode—
classNamestring—
disabledbooleanfalse
mode"primary" | "secondary"primary
onRemove((event: MouseEvent<HTMLButtonElement, MouseEvent>, value: string | number) => void)—
readOnlybooleanfalse
removablebooleantrueShows the remove button (hidden anyway while `disabled` or `readOnly`).
removeLabelstringRemoveAccessible label of the remove button; the chip text is appended.
valuestring | number—Passed back to `onRemove`.