Skip to content

AttachmentChip

Stable

A tag for an attached file or image, with name, size, upload progress, an error with Retry, and Remove.

Also known as attachment, file chip, uploaded file

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

Ready, uploading and failed

q3-planning.pdf2.4 MB
board-deck.pptx
Uploading 45% of 18 MB
site-photo.pngUpload failed. Check your connection.

All three states together. Retry on the failed one makes it ready.

When to use it

Shows one file attached to a message, with its upload state. Progress, failure and the way out are all visible, so people know whether the file will be sent.

Made of: Thumbnail or icon · Name · Size · Progress bar · Error message · Retry · Remove

Use it for

  • A file or image attached in the message box.
  • An upload in progress, with a bar and a percentage.
  • An upload that failed, with the reason and a Retry button.

Not for

Do and avoid

March invoice.pdfUpload failed
Do. A failed upload says so and offers Retry right there.
March invoice.pdfUpload failed
Avoid. A failed file with no Retry or Remove leaves people stuck.

Do

  • Say what went wrong and what the person can do.
  • Keep Remove available while uploading so a person can cancel.
  • Use a real thumbnail for images when you have one.

Avoid

  • Do not use amber for a failed upload. Use red with a Retry button.
  • Do not show progress without a visible percentage.
  • Do not use it for tools. Use ToolChip.

On a phone

  • The chip is 16rem wide but shrinks to fit a narrower container.
  • A long file name is cut off with an ellipsis, and the full name is only in a title tip that does not show on touch, so show the full name elsewhere if it matters.
  • The Retry and remove buttons keep their size and have a 44px tap area on touch screens.

Seen in products

  • Vercel AI Elements ships Attachments.
  • Shape of AI lists Attachments as a Tuner.
  • assistant-ui docs list Attachments as a primitive.

Build your next AI screen with Tattva.

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

Get started