Skip to component
GGamma

Attachment list

File rows with upload progress, clear failure feedback, and retry or removal actions.

New

Project files

Files attached to the design review.

  • Design brief.pdfPDF, 180 KiBReady
  • Product screenshots.zipZIP, 3.5 MiBUploading
  • Floor plan.pngPNG, 900 KiBConnection lost. Retry the upload.

Retry the failed file to preview its upload.

Live previewUse keyboard to interact

Implementation

1"use client";2 3import { useEffect, useRef, type HTMLAttributes } from "react";4import {5  Download,6  ExternalLink,7  FileImage,8  FileText,9  RotateCcw,10  X,11} from "lucide-react";12 13type AttachmentDetails = {14  id: string;15  name: string;16  /** A human-readable format such as PDF, PNG, or application/pdf. */17  type?: string;18  /** File size in bytes. */19  size?: number;20  /** An application-supplied URL; only ready files expose it. */21  url?: string;22  /** Use the URL as a download, optionally supplying its filename. */23  download?: boolean | string;24  disabled?: boolean;25};26 27export type AttachmentItem = AttachmentDetails &28  (