Skip to content
Get Pro

Attachments

File and image attachments with progress, failure recovery, metadata, and removal actions.

  • component-layout.png

    2.4 MB

  • agent-spec.pdf

    1.8 MB

  • project-notes.docx

    340 KB

  • trace.json

    24 KB

Default

  • agent-spec.pdf

    1.8 MB

Uploading

  • agent-spec.pdf

    45% uploaded

Failed

  • agent-spec.pdf

    Upload failed

Installation

Add the component source directly to your project.

pnpm dlx shadcn@latest add https://pastaui.com/r/attachments.json

API reference

Attachments

Attachments properties
PropTypeDefaultDescription
variant"default" | "uploading" | "failed"defaultSets the attachment state. Individual item status values override this variant.
itemsAttachmentItem[]Provides files and their transfer state.
onRemove(id: string) => voidRemoves an attachment.
onRetry(id: string) => voidRetries a failed upload.