Skip to content
caliper ui pro docs

Attachment

A file or image chip for chat inputs and forms, with an upload fill, a failed state with Retry and a card for images.

Pro

Here are the October exports and the close checklist. The 2025 ledger is too large; I will split it.

  • close-checklist-q3.pdf2.4 MB
  • bank-export-october.csvUploading 20%
  • ledger-2025.xlsxOver 10 MB ·
  • lisbon-office.jpg1.1 MB

When to use

  • Files attached to a message, a ticket or a form.
  • A queue of uploads with their own progress.

When not to use

  • A page of files with actions per file; use the file manager or items.

Installation

terminal
pnpm dlx shadcn@latest add @caliper/attachment

Adds its 2 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.

API reference

Attachment

9 props

Also accepts the native props of its root element and a ref.

PropTypeDefaultDescription
name *string—
sizenumber—Bytes. Shown after the name once the file is done.
state"error" | "done" | "uploading""done"
progressnumber00 to 100 while uploading. The fill grows with it and the text says it too.
errorstring—What went wrong, with the limit if there is one: "Over 10 MB".
variant"pill" | "card""pill"A pill is one line; a card shows `preview` above the name, for images.
previewReactNode—The image or icon for a card.
onRemove(() => void)—
onRetry(() => void)—

AttachmentList

0 props

No props of its own; it accepts the native props of its root element.

Keyboard

  • No custom key handling; Tab and the native activation keys do the work.

Accessibility

It is built on native elements and keeps aria-label and aria-hidden in step with state.

Notes for AI

Give your coding assistant this page as Markdown instead of screenshots: the props, keyboard and examples in one file.

/docs/components/attachment.md

The index of every part is at /llms.txt.

More in Files