Skip to content
Uxelith
Sign in
Prov1.0.0Forms

File Dropzone

Drop, paste or browse for files: the zone lights up as a file crosses the page and warns before a wrong type lands; files show thumbnails and upload with live, cancellable progress.

Installs with Uxelith ProHow
Licence
Pro
Packages
2
Updated
9 Oct 2026
Live

Installation

Usage

example.tsx
"use client"

import { FileDropzone } from "@/components/file-dropzone"

export function Attachments() {
  return (
    <FileDropzone
      accept="image/*,.pdf"
      maxSize={5 * 1024 * 1024}
      maxFiles={4}
      upload={async (file, onProgress) => {
        const body = new FormData()
        body.append("file", file)
        await fetch("/api/upload", { method: "POST", body })
        onProgress(1)
      }}
    />
  )
}

Props

PropTypeDefaultDescription
acceptstring—Like the input's accept: "image/*,.pdf".
maxSizenumber—Largest file in bytes.
maxFilesnumberInfinityMost files at once.
upload(file, onProgress, signal) => Promise<void>—Upload one file and report 0–1 progress; throw to fail it. The signal aborts on cancel.
onFilesChange(files: DropzoneFile[]) => void—Called after the list changes.
title / hintReactNode"Drop files here or browse" / from limitsText inside the zone.
labelstring"Upload files"Accessible name of the button and file list.
thumbnailsbooleantrueShow a thumbnail for images (a temporary blob: URL, freed on remove).
pastebooleantrueAccept files pasted with Ctrl/⌘+V while the zone has focus.
--dropzone-accentCSS variable--primaryDrag and progress colour.

Accessibility

  • The zone is a real button that opens the native file picker (Enter / Space).
  • Files can be pasted into the focused zone, not only dragged, so keyboard users have a fast path too.
  • Refused files are announced with a reason; successes are announced politely.
  • Each upload is a progressbar with its file name; Cancel, Remove and Retry buttons name their file.
  • The marching border, fanning pages, shake on refusal and row collapse are all removed under prefers-reduced-motion.

Changelog

  1. v1.0.0Latest

    First release.

More in Forms

All 10 in Forms
  • FormsFree

    Animated Input

    A text field whose label floats out of the way, with examples that take turns while it's empty, an error that shakes once, a tick for a valid value and sent text that drifts away.

  • FormsPro

    Date Picker

    Single dates and ranges in a keyboard-first calendar, with one-tap presets ("Last 7 days"), months that slide the way you go, min/max, unavailable days and ISO strings for forms.

  • FormsPro

    Multi Select

    Pick several options from a searchable list: chips pop in and slide aside as others leave, matches are highlighted, and creatable turns it into a tag input. Limits, icons and forms.