nextui.dev
Home
Docs
Saved
Pricing
Components37
  • Forms & inputs7
  • Cards13
  • Buttons, badges & avatars8
  • Feedback & display6
  • Effects3
Agents17
  • Chat inputNew
  • Task checklistNew
  • ReasoningNew
  • Tool callNew
  • Tool approvalNew
  • SourcesNew
  • Agent timelineNew
  • Artifact panelNew
  • Streaming messageNew
  • Conversation shellNew
  • Voice agentNew
  • Voice orbNew
  • Thinking ring
  • Thinking waveNew
  • Thinking sparkle
  • Thinking bot
  • Prompt deckNew
Blocks20
  • Agent chatNew
  • Pill heroNew
  • Grid hero
  • Moodboard generatorNew
  • Waitlist heroNew
  • Intro bannerNew
  • Creative home heroNew
  • Chat heroNew
  • App shelfNew
  • Usage card
  • Design resultsNew
  • Pricing tiers
  • Dashboard home
  • The shiftNew
  • Launch perksNew
  • Testimonials
  • Quote
  • Team
  • Leads tableNew
  • Sign in
Pages10
  • ASCII workspace$49
  • CRM overviewNew
  • Marketing dashboardNew
  • Developer portfolio$49
  • Particle landing$49
  • Particle story$49
  • Statement converter$49
  • AI photo studio$49
  • Group card launch$49
  • Month-end storyNew
Themes9
  • Default
  • Ember
  • Ocean
  • Forest
  • Grape
  • Rose
  • Amber
  • Clay
  • Brutal
Upgrade
nextui.dev

nextui components, blocks and themes you install with one command.

Product

  • Components
  • Blocks
  • Themes
  • Pricing

Resources

  • Docs
  • Roadmap
  • GitHub

Legal

  • License
  • Privacy
  • Terms
  • Refunds

nextUI

[ 200 OK ] · nextUI

© 2026 NEXTUI • All rights reserved.

Upgrade
ComponentsForms & inputsDropzone
Copy promptCopy prompt

Customize

Largest file allowed, in MB

25 MB

Allow picking several files at once

Line under the drop zone

Play the scripted upload from the preview instead of using files

JSX · copied with Copy prompt

<FileDropzone demo hint="PDF, PNG, JPG and more · up to 25 MB each" />

Dropzone

Drop zone that grows as files land, with per-file progress, errors and retry.

Installation

Set your access key from API keys as NEXTUI_TOKEN in .env.local and add the @nextui namespace below to components.json once. Then every item installs by name. Each install counts as a copy on a free account.

$pnpm dlx shadcn@latest add @nextui/dropzone
1{
2 "registries": {
3 "@nextui": {
4 "url": "https://nextui.dev/r/{name}.json",
5 "headers": { "Authorization": "Bearer ${NEXTUI_TOKEN}" }
6 }
7 }
8}

Usage

1"use client";
2
3import { useState } from "react";
4import { FileDropzone, type DropzoneFile } from "@/components/nextui/dropzone";
5
6export function Upload() {
7 const [files, setFiles] = useState<DropzoneFile[]>([]);
8 const update = (id: string, patch: Partial<DropzoneFile>) =>
9 setFiles((list) => list.map((f) => (f.id === id ? { ...f, ...patch } : f)));
10
11 return (
12 <FileDropzone
13 files={files}
14 maxSizeMB={25}
15 accept="image/*,.pdf"
16 onFiles={(accepted, rejected) => {
17 const added = accepted.map((file) => ({ id: crypto.randomUUID(), name: file.name, size: file.size, status: "uploading" as const, progress: 0 }));
18 const tooBig = rejected.map((file) => ({ id: crypto.randomUUID(), name: file.name, size: file.size, status: "rejected" as const }));
19 setFiles((list) => [...list, ...added, ...tooBig]);
20 // Start your uploads here and call update(id, { progress }) / update(id, { status: "done" }).
21 }}
22 onRemove={(id) => setFiles((list) => list.filter((f) => f.id !== id))}
23 onRetry={(id) => update(id, { status: "uploading", progress: 0 })}
24 onClear={() => setFiles([])}
25 />
26 );
27}

API reference

Edit props live in the preview above, or see all 11 props
PropTypeDefaultDescription
filesDropzoneFile[][]The list to show: id, name, size in bytes, status, progress (0 to 1) and an optional error
onFiles(accepted: File[], rejected: File[]) => void–Files dropped or picked; rejected ones are larger than maxSizeMB
onRemove(id: string) => void–The × on a row was clicked
onRetry(id: string) => void–The retry icon on a failed row was clicked
onClear() => void–Clear was clicked once every upload settled
acceptstring–Allowed types for the file picker, e.g. "image/*,.pdf"
maxSizeMBnumber25Largest file allowed, in MB
multiplebooleantrueAllow picking several files at once
hintstring"Up to {maxSizeMB} MB each"Line under the drop zone
demobooleanfalsePlay the scripted upload from the preview instead of using files
classNamestring–Extra class on the root

How it works

  • The component handles drag and drop, the file picker and the list; you own the upload and the files state
  • Statuses: uploading shows a progress bar, done a check, failed a retry button, rejected the size limit

Related

All components

Labeled input

Subscribe input

Settings list

Sign in to see the code

Preview it freely. A free account copies code and prompts a few times a day.

Sign in