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
.cronus
The same component declared in Cronus. Emitted at build time from the audit fixtures — the kernel renders it as HTML with no React.
default.cronus
app "audit-fixtures" {
port 5176
}
style {
preset aurora
theme dark
}
component ChipDefault layout:inline style:chip {
label "Design"
}
page "/audit/chip/default" type:custom {
use ChipDefault
}
API Reference
Generated from the component's exported types.
ChipLabels
| Prop | Type | Default | Description |
|---|---|---|---|
remove* | string | "Remove" | Screen-reader string for the remove affordance: the accessible name of the remove button on a non-interactive chip, and the Delete/Backspace removal hint (exposed as the chip's accessible description) on an interactive one. |
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 . |
asChild | boolean | — | Render as the child element via Slot. |
children | ReactNode | — | Contents of the component. |
className | string | — | Additional class names merged onto the root. |
id | string | — | DOM id of the root element. |
ChipGroupProps
Extends HTMLAttributes<HTMLDivElement>
| Prop | Type | Default | Description |
|---|---|---|---|
aria-label | string | — | Accessible name announcing what the chip collection represents. |
className | string | — | Additional class names merged onto the root. |
children | ReactNode | — | Contents of the component. |
id | string | — | DOM id of the root element. |