Fulldev UI

Displays a file or image attachment with media, metadata, state, and actions.

Workspace
workspace.pngPNG · 820 KB
Desk
desk-reference.jpgJPG · 1.1 MB
Office
office-reference.jpgJPG · 940 KB
sales-dashboard.pdfUploading · 64%
message-renderer.tsxTypeScript · 12 KB

Installation

npx shadcn@latest add @fulldev/attachment

Usage

---
import FileIcon from "@lucide/astro/icons/file"

import {
  Attachment,
  AttachmentContent,
  AttachmentDescription,
  AttachmentMedia,
  AttachmentTitle,
} from "@/components/ui/attachment"
---

<Attachment>
  <AttachmentMedia>
    <FileIcon />
  </AttachmentMedia>
  <AttachmentContent>
    <AttachmentTitle>report.pdf</AttachmentTitle>
    <AttachmentDescription>2.4 MB</AttachmentDescription>
  </AttachmentContent>
</Attachment>

Attachment is a presentation component. It does not select, upload, remove, or persist files.

Image

Set variant="image" on AttachmentMedia and render an <img> inside it. Use orientation="vertical" to stack the media above the content.

Workspace
workspace.pngPNG · 820 KB
Desk
desk-reference.jpgJPG · 1.1 MB
Office
office-reference.jpgJPG · 940 KB

States

selected-file.pdfReady to upload
design-system.zipUploading · 64%
market-research.pdfProcessing document
financial-model.xlsxUpload failed. Try again.
uploaded-report.pdfUploaded · 1.8 MB

Sizes

Default attachmentPDF · 2.4 MB
Small attachmentPDF · 2.4 MB
Extra small attachment

Group

briefing-notes.pdfPDF · 1.4 MB
workspace.png
workspace.pngPNG · 820 KB
customers.csvCSV · 18 KB
renderer.tsxTSX · 12 KB

Trigger

Add an AttachmentTrigger to make the whole card open a link or dialog. It fills the card behind the actions, so the actions stay clickable.

research-summary.pdfOpen preview dialog

API Reference

Attachment

PropTypeDefaultDescription
state"idle" | "uploading" | "processing" | "error" | "done""done"Visual file state.
size"xs" | "sm" | "default""default"Controls spacing and type size.
orientation"horizontal" | "vertical""horizontal"Controls card layout.

AttachmentMedia accepts variant="icon" | "image". AttachmentAction uses the Button API and supports as. AttachmentTrigger is polymorphic and covers the card, so give it visible or screen-reader-only link text. All parts forward native attributes.

Source: src/components/ui/attachment