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.jsonAPI reference
Attachments
| Prop | Type | Default | Description |
|---|---|---|---|
variant | "default" | "uploading" | "failed" | default | Sets the attachment state. Individual item status values override this variant. |
items | AttachmentItem[] | — | Provides files and their transfer state. |
onRemove | (id: string) => void | — | Removes an attachment. |
onRetry | (id: string) => void | — | Retries a failed upload. |