File Uploader

A bold red dropzone for any file, with gallery tiles and progress after upload.

elite micro interactionsfileuploaderframer motiontabler icons react
File Uploader component preview

Overview

File Uploader is a React and Tailwind CSS drag and drop file upload component, in Next.js or any React app, with a bold dropzone and a choose files button. Images land as preview tiles and documents as cards with a circular progress ring, while files that break accept or maxSize show an error instead of uploading. Pass onUpload to send each file to S3, UploadThing, or your own API and report progress through the callback, and thrown errors appear on the card. Without onUpload the progress is simulated, and maxSize defaults to 10 MB.

Installation

Run the following command

~/your-project
pnpm dlx wensity@latest add file-uploader

Usage

Import FileUploader from @/components/wensity/file-uploader and render it anywhere in your React or Next.js app. The source lands in your own repo, so every prop, class and animation below is yours to edit.

app/example.tsx
"use client";
import { FileUploader, type UploadFile } from "@/components/wensity/file-uploader";
export default function Example() {
return (
<FileUploader
color="#DC2F2F"
buttonLabel="Choose files"
description="or drop files here"
maxFiles={6}
onChange={(files: UploadFile[]) => console.log(files)}
onUpload={async (file, onProgress) => {
// Replace with your API upload — call onProgress(0..100)
onProgress(100);
}}
/>
);
}

Props

PropTypeDefaultDescription
valueUploadFile[]-Controlled file list.
defaultValueUploadFile[]-Seed files for uncontrolled usage.
onChange(files: UploadFile[]) => void-Fired whenever the file list changes.
onUpload(file: File, onProgress: (percent: number) => void) => Promise<void>-Custom upload handler. When omitted, progress is simulated locally.
onRemove(file: UploadFile) => void-Fired when a file is removed from the list.
acceptstring-HTML accept string. Omit to allow all file types.
maxFilesnumber8Maximum number of files. Extra picks are ignored.
maxSizenumber10485760Maximum bytes per file. Oversized files land as errors.
buttonLabelstring"Choose files"Label inside the solid choose button.
descriptionstring"or drop files here"Supporting line under the button.
colorstring"#DC2F2F"Dropzone accent color. Hover/drag uses a darker mix.
multiplebooleantrueAllow selecting multiple files.
disabledbooleanfalseDisable interaction.