Command Palette

Search for a command to run...

UploadThing/UploadThing File Card

UploadThing File Card

A beautiful file card displaying uploaded file info with copy URL, download, open, and remove actions.

Open in v0Open in
profile-photo.jpg

profile-photo.jpg

2.34 MBJPEG

document.pdf

1 MBPDF

presentation.mp4

15 MBMP4

Overview

A file display card with type-specific icons, image preview, file size formatting, and action buttons for copy, download, and remove.

Installation

npx shadcn@latest add @elements/uploadthing-file-card

Usage

import { UploadThingFileCard } from "@/components/elements/uploadthing/uploadthing-file-card";

export function FileDisplay() {
  return (
    <UploadThingFileCard
      name="document.pdf"
      size={1024 * 1024 * 2.5}
      type="application/pdf"
      url="https://example.com/document.pdf"
      onRemove={() => console.log("removed")}
      onDownload={() => window.open(url)}
    />
  );
}

Props

PropTypeDefaultDescription
namestring-File name
sizenumber-File size in bytes
typestring-MIME type
urlstring-File URL
onRemove() => void-Called when remove is clicked
onDownload() => void-Called when download is clicked
showPreviewbooleantrueShow image preview for images
classNamestring-Additional CSS classes

Features

  • Type-specific icons (image, video, audio, PDF, code, archive, text)
  • Image thumbnail preview
  • Human-readable file size
  • Copy URL to clipboard
  • Download and remove actions