ContextChip · ContextChipView

One attached thing the assistant can see — the chip that makes context visible instead of implied.

Install it:

npx shadcn add @ambientui/context-chip

Live

Attached context

Design system · FoundationEditor · composer.tsxAccent colorSemantic mapping

Compact — chips sharing the input's line

Design system · FoundationAccent color

Behavior

  • ·ONE anatomy everywhere: an icon tile typed by what was attached, the label, and a squared remove control. Two sizes only — default where the composer has a row of its own, compact where chips share the input's line — and a surface picks the size, never the look.
  • ·The tile is typed by KIND: page → document, control → sliders, target and cell → layers, file and symbol → code, selection → type. Names from the icon vocabulary, so chips redraw with the Foundation's configured library like everything else.
  • ·A chip may override that with its own `icon`. Every page is kind "page", which is too coarse to tell an editor from a colour map from an essay, and the page is the only thing that knows which — so /ds sends the icon of the rail row you are standing on, and the dev tool sends `code`.
  • ·SPARKLES IS NEVER A CHIP ICON. In this system that mark means the assistant — its character, AskAI, the follow-up heading — and a chip is what the assistant can SEE, not the assistant. It was the page kind's icon and the component page's icon until both were caught; an icon is a word, and lending the assistant's word to a page costs that word its precision.
  • ·The page's own chip arrives automatically (setPageChip); anything else is something the user attached by right-clicking an element.
  • ·Every chip carries a remove control, because everything here is a decision that can be undone — including keeping the page attached.
  • ·Truncates rather than wraps: a chip names its source, it does not quote it.
  • ·Chips ride every AI form factor, so what the assistant can see is the same wherever you ask from.
  • ·ONE ROW ABOVE THE INPUT, and everything the question is about rides in it — the page chip, attached chips, and staged attachments, in a single ChipSlider that pages with arrows. Context and attachments were two stacked rows, which read as two different kinds of thing and cost twice the height above the smallest part of the surface. They are one kind of thing: material the answer will rest on.
  • ·It SCROLLS rather than wraps. Wrapping grew the composer upward as context accumulated, pushing the transcript around while the user was still writing; one scrolling row costs the same height whether it holds one chip or nine.
  • ·Removing one takes it out of the next question's grounding, and the answer's references will show the difference.

When to use

  • ·Above any AI input, to show what the answer will be grounded in before it is asked.
  • ·Whenever the assistant gains access to something new mid-conversation.

When not to

  • ·For filters or tags in product UI — this pill claims 'the assistant can see this', which is a specific promise.
  • ·For results or citations after an answer — that is ReferenceChips.