Skip to content

ContextChip

Stable

A small tag near the message box that shows what the chat is about.

Also known as context pill, context chip, mention chip, attached context

Install with npm install @tattva/ui (setup), or copy the code from the kit in Downloads.

Picker and removable

Q3 planning.pdf

The first tag opens a list of choices. The second is something attached that the person can remove.

When to use it

Shows what the chat is about, right beside the message box. It can open choices, be removed, or simply sit there as a label.

Made of: Icon · Label · Arrow (for choices) · Remove button

Use it for

  • Showing the project, file or folder the chat is limited to.
  • Letting a person change that scope: give it onClick to open choices.
  • Letting a person drop the scope: give it onClear.

Not for

Do and avoid

March invoice.pdf
Do. A short name shows what the chat is about at a glance.
March 2026 invoice for the Lisbon team offsite, final version, signed copy.pdf
Avoid. A very long file name crowds the message box and is hard to scan.

Do

  • Make it pressable when the topic can be changed. Add a remove button when it can be removed.
  • Keep labels to a few words, like a file name.
  • Put tags in one row near the message box.

Avoid

  • Do not make a tag both pressable and removable unless both make sense.
  • Do not use it for tags or filters in a table. It is only for the message box.
  • Do not use very long file names. Shorten them first.

On a phone

  • On touch screens the pill stays 28px tall. Its clear button, and the pill itself when it is a button, keep their size and have a 44px tap area.
  • It has no hover-only parts: the picker opens on tap and the clear button is always shown.
  • The label has no truncation, so keep it short for a narrow screen.

Build your next AI screen with Tattva.

Free and open, with the code. Start in one line.

Get started