Chip
A 24px pill token for modes, context files and attachments, optionally removable.
import { Chip } from "@arcadia/ui"A 24px token for what someone put in the composer: the mode chip (Plan), context files and attachments. With onRemove it ends in a 16px remove button in the chip's colour, with its own label and tooltip; remove one above and the rest close up. Its icon sits beside the label, framed and stroked by the label's text.
Chip or Badge? A chip is a token someone added and can take away. A Badge only states something, a count, a shortcut or a status, and can't be pressed.
Examples
Tones
The same tones as Badge. A mode chip takes its mode's tone (plan, ask, debug); a context chip stays neutral, or muted once it no longer applies.
rootStyle takes where the chip sits (margins, self-alignment, flex and grid placement, size bounds) and the knobs below, each a token of its kind. A colour, a raw length or any other property is a type error: a look that comes up twice becomes a variant.
--chip-bg- PaintDefault var(--fill-3)
- Fill (the tone's wash).
--chip-fg- PaintDefault var(--text-2)
- Label colour, and the remove button's.
--chip-icon- PaintDefault var(--icon-2)
- Leading glyph colour.
--chip-max-w- Ref<Measure>Default 240px
- Width past which the label fades.
Tones only reassign the knobs. The remove button takes the chip's text colour, so a tone recolours it too.
The chip itself is a <span>; only its remove button is focusable, named by removeLabel (default "Remove"). Name it after what it removes ("Remove dialog.tsx") when several chips sit together, or every button reads the same.
Removing a chip takes its button out from under focus, so move focus somewhere sensible, such as the composer's text field or the next chip.
Chip
tone- "neutral" | "muted" | "accent" | "success" | "warning" | "danger" | "plan" | "ask" | "debug"Default "neutral"
- Shared by Badge and Chip. Mode tones (plan / ask / debug) tint at --mode-soft-strength.
icon- IconName
weight- "regular" | "medium"Default "regular"
onRemove- () => void
- Renders a trailing remove button (a 16px IconButton, "x", in the chip colour).
removeLabel- stringDefault "Remove"
- The remove button's label and tooltip.
removeHint- ReactNode
- Extra tooltip line for the remove button, e.g. the shortcut's effect.
rootStyle- ChipStyle
- Typed StyleX override: where the chip sits and its
--chip-*knobs. className- string
- A product's hook class, retiring: new code uses
rootStyle(ui.lintkit-classnamecounts the rest).
Rest props go to <span> props and render.