Attachment

File and image cards with upload states.

shadcn/ui · new-york-v4 · synced Aug 29, 2026shadcn/uinew-york-v4 · synced Aug 29, 2026

Installation

import {
  Attachment,
  AttachmentMedia,
  AttachmentContent,
  AttachmentTitle,
  AttachmentDescription,
  AttachmentActions,
  AttachmentAction,
  AttachmentGroup,
} from "@aspyn-io/kit";

File attachment

Media, name, and metadata with an independently clickable action.

sales-dashboard.pdfPDF · 2.4 MB

Upload states

Set state to reflect the lifecycle: idle, uploading, processing, error, done. "error" switches to a destructive treatment.

uploaded-report.pdfUploaded · 1.8 MB
design-system.zipUploading · 64%
financial-model.xlsxUpload failed. Try again.

Group

AttachmentGroup lays multiple attachments out in a scrollable, snapping row.

briefing-notes.pdfReady to upload
customers.csvReady to upload
renderer.tsxReady to upload

Notes

  • Set variant="image" on AttachmentMedia and render an <img> inside for image previews; orientation="vertical" stacks the media above the content.
  • AttachmentTrigger is a full-card overlay (link or dialog) that sits behind AttachmentActions, so the card is clickable while the actions stay independently operable — give both aria-labels.
  • AttachmentAction renders a Button; keep icon-only actions labeled with aria-label.