File Uploader

PreviousNext

A flexible file uploader component with drag-and-drop support, file validation, preview capabilities, and progress tracking.

File upload component with drag-and-drop, file validation, preview, and progress tracking. Supports 4 variants and collection layouts.

Basic Usage

Upload a file

Click to browse or drag and drop

Variants

Dropzone Variant

Large drag-and-drop area perfect for prominent upload sections.

Drop your files here

or click to browse

Button Variant

Compact button-style uploader for toolbars and inline forms.

Card Variant

Card-based uploader with title and description wrapper for form sections.

Upload Project Files

Add project files

Upload project documents, images, or other assets

File Types & Validation

Image Upload

Upload images with type validation and file preview.

Upload images

Supports JPG, PNG, GIF, WebP

Max size: 5 MBAccepted: image/*

Document Upload

Accept specific document types like PDF, Word, or Excel files.

Upload documents

PDF, DOC, DOCX accepted

Max size: 10 MBAccepted: application/pdf,.doc,.docx

Accept Format:

  • MIME types: "image/*", "application/pdf", "video/mp4"
  • Extensions: ".jpg", ".png", ".pdf", ".doc"
  • Combined: "image/*,.pdf,.doc,.docx"

Common Size Limits:

  • 1024 * 1024 = 1MB
  • 5 * 1024 * 1024 = 5MB
  • 10 * 1024 * 1024 = 10MB

Multiple Files

Allow users to upload multiple files at once.

Upload multiple files

0 file(s) uploaded

Progress Tracking

Show upload progress for better user feedback during async operations.

Upload with progress

Watch the upload progress

Error Handling

Display validation errors and handle upload failures gracefully.

Upload file

Max size: 100 KB

Collections

Stack Layout

Stack multiple uploaders vertically, perfect for forms.

Profile Picture

Upload your profile picture

Max size: 2 MBAccepted: image/*

Resume/CV

Upload your resume (PDF only)

Max size: 5 MBAccepted: application/pdf

Cover Letter

Upload your cover letter

Max size: 5 MBAccepted: application/pdf,.doc,.docx

Form Integration

Integrate file uploads seamlessly into forms.

Attachment

Upload a file

API Reference

FileUploaderItem Props

PropTypeDefaultDescription
labelstring"Upload files"Label text displayed in the dropzone
descriptionstring-Optional description text
titlestring-Title for container variant
acceptstring-Accepted file types (MIME types or extensions)
maxSizenumber-Maximum file size in bytes
maxFilesnumber1Maximum number of files allowed
multiplebooleanfalseAllow multiple file selection
disabledbooleanfalseDisable the uploader
requiredbooleanfalseMark as required (for forms)
errorstring-Error message to display
allowDragDropbooleantrueEnable drag and drop functionality
showPreviewbooleantrueShow file preview after upload
showProgressbooleanfalseShow upload progress bar
onUpload(files: File[]) => void | Promise<void>-Callback fired when files are uploaded
onRemove(file: File) => void-Callback fired when a file is removed
onError(error: string) => void-Callback fired on validation errors
dropzoneVariant"default" | "dropzone" | "button" | "card""default"Visual variant of the dropzone
dropzoneSize"sm" | "md" | "lg""md"Size of the dropzone
showContainerbooleanfalseShow container wrapper with title
containerVariant"card" | "outline" | "ghost" | "minimal""card"Container visual variant
containerSize"sm" | "md" | "lg""md"Container size
classNamestring-Additional CSS classes
ariaLabelstring-Accessibility label

FileUploaderCollection Props

PropTypeDefaultDescription
itemsFileUploaderItemProps[]RequiredArray of uploader configurations
layout"stack" | "grid" | "inline""stack"Layout direction for the collection
columns1 | 2 | 3 | 41Number of columns (grid layout only)
gap"sm" | "md" | "lg""md"Gap between items
dropzoneVariant"default" | "dropzone" | "button" | "card""default"Shared dropzone variant
dropzoneSize"sm" | "md" | "lg""md"Shared dropzone size
showPreviewbooleantrueShared preview setting
showProgressbooleanfalseShared progress setting
allowDragDropbooleantrueShared drag & drop setting
onItemUpload(item, files, index) => void-Callback fired when any item uploads
classNamestring-Additional CSS classes