Skip to content
Forms

Chip

Server Component

Interactive filter/selection chip — toggleable, dismissible, with icon and avatar slots.

Import

tsx
import { Chip } from "@cronus-ui/ui";
bash
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.

PortedParity: MatchGeometry 1/1Pixel diff 0 pxLogic 1/1Parity scoreboard
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

Skip ChipLabels props table
PropTypeDefaultDescription
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">

Skip ChipProps props table
PropTypeDefaultDescription
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
booleanundefinedToggle 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
booleanfalseDisables 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>

Skip ChipGroupProps props table
PropTypeDefaultDescription
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.