Skip to content
Calm motion: animations on this site only fade, with no movement

Context chips ​

The files and pages that go with a message, as chips that you can remove

Shows above a prompt input what the AI assistant gets with the next message, so the person knows what it can see.

Basic
  • File launch-plan.pdf 3.1k tokens
  • Page Pricing — Studio mic 900 tokens
  • Selection Lines 40–88 of checkout.ts
  • Image cover-draft.png
  • items is the list. Each item has an id, a label, a kind, and an optional detail, such as the size or the number of tokens.
  • The kind is file, page, image, folder, or selection. It shows as a word in front of the label.
  • Each chip is a chip with a remove button. The button has the label in its name, as in "Remove launch-plan.pdf", and emits remove with the id.
  • addable shows an "Add context" button that emits add. Open your file picker or page search from it.
  • A long label is cut with an ellipsis. The full label stays in the name of the remove button.
  • Change the words with labels or a label pack. The API table lists the keys.

Usage ​

ts
import { BlessContextChips } from "blessing-ui";

API ​

Props

NameTypeDefaultDescription
items*BlessContextItem[]—
addableboolean—show an Add button that emits `add`
labelsPartial<Record<BlessContextKind, string> & { list: string; add: string; remove: string; }>—

Events

NamePayloadDescription
add[]
remove[id: string]

Released under the MIT License. Character names and artwork belong to their owners.