Chip
Server ComponentInteractive filter/selection chip — toggleable, dismissible, with icon and avatar slots.
Import
import { Chip } from "@cronus-ui/ui";
npx cronus-ui add chip
Examples
API Reference
Generated from the component's exported types.
ChipProps
Extends Omit<HTMLAttributes<HTMLElement>, "color">, Omit<VariantProps<typeof chipVariants>, "interactive" | "selected">
| Prop | Type | Default | Description |
|---|---|---|---|
variant | "solid" | "soft" | "outline" | "soft" | Visual treatment: `solid` fill, `soft` 15% tint, or `outline`. |
color | "neutral" | "primary" | "success" | "warning" | "error" | "info" | "neutral" | Semantic hue applied by the variant recipe. |
size | "sm" | "md" | "lg" | "md" | Pill height / typography preset. |
selected | boolean | undefined | Toggle state for filter-style chips. Any non-`undefined` value renders the chip as a `<button>` with `aria-pressed`; while `true` it also gains a leading check mark and emphasized styling. |
icon | ReactNode | — | Leading icon slot rendered before the label (e.g. a lucide icon). |
avatar | ReactNode | — | Leading avatar slot (an `img`, `Avatar`, …) clipped to a circle and sized by `size`. |
onRemove | () => void | — | Makes the chip dismissible. On a static chip this renders a real, focusable remove button (Enter/Space activate it); on an interactive chip the affordance is decorative and Delete or Backspace on the focused chip removes it instead. Removal never triggers `onClick`, and removal clicks never propagate to ancestor click handlers. |
disabled | boolean | false | Disables the chip and its remove affordance. |
labels | Partial<ChipLabels> | — | Override any subset of the built-in screen-reader strings. See . |
ChipGroupProps
Extends HTMLAttributes<HTMLDivElement>
| Prop | Type | Default | Description |
|---|---|---|---|
aria-label | string | — | Accessible name announcing what the chip collection represents. |