2

File Upload

Upload, validate, and queue documents with drag-and-drop, file type rules, progress states, and retry handling.

File Upload is the starting point for document processing workflows. It should help users get files into the system quickly while making validation, progress, and failure states clear.

import { FileUpload } from "@/components/ui/file-upload";

export function FileUploadExample() {
  return (
    <div className="rounded-xl border bg-background p-4">
      <FileUpload />
    </div>
  );
}

Installation

pnpm dlx shadcn@latest add https://ui.extend.ai/r/file-upload.json

Useful behaviors

  • Drag-and-drop and file picker entrypoints.
  • File type, size, page count, and duplicate validation.
  • Upload progress, cancel, retry, and queued states.
  • Batch upload summaries for mixed PDFs, DOCX files, Excel workbooks, images, and CSVs.
  • Hooks for parsing, extraction, review, or routing once files are accepted.

API Reference

FileUpload

The FileUpload component renders a drag-and-drop file picker, validates accepted files, and keeps an internal upload queue unless you mirror it through callbacks.

PropTypeDefaultRequired
acceptstring-No
acceptedFileTypesAcceptedFileType[]Image, PDF, and Sheet iconsNo
borderBeamThemeReact.ComponentProps<typeof BorderBeam>["theme"]"light"No
browseLabelstring"Browse files"No
classNamestring-No
descriptionstring"PDF, DOCX, XLSX, CSV, PNG, or JPG"No
draggingLabelstring"Drop to add"No
multiplebooleantrueNo
showBorderBeambooleantrueNo
showFileListbooleantrueNo
titlestring"Click to upload or drop files"No
onFilesAccepted(files: File[]) => void-No
onFilesChange(files: FileUploadItem[]) => void-No