Components

File dropzone

A drop target with a liquid surface: it swells when a file is dragged over, a pool of light follows the file, and a drop sends a splash ring out from where it landed.

Paste it into ChatGPT, Claude, Cursor or v0.
accept

Usage

React
import { FileDropzone, toast } from '@vizzele/react';

const [files, setFiles] = useState<File[]>([]);

<FileDropzone
  accept="image/*,.pdf"
  maxSize={5 * 1024 * 1024}
  maxFiles={4}
  files={files}
  onFilesChange={setFiles}
  onReject={(r) => toast.error(`${r[0].file.name}: wrong ${r[0].reason}`)}
  hint="PNG, JPG or PDF — up to 5 MB"
/>

Props

PropTypeDefaultDescription
acceptstring—Like <input accept>: "image/*,.pdf".
multiplebooleantrueKeep several files.
maxSizenumber—Largest file, in bytes.
maxFilesnumber—Most files kept at once.
files / onFilesChangeFile[]—Controlled list (uncontrolled if omitted).
onReject(FileRejection[]) => void—Files turned away: { file, reason: 'type' | 'size' | 'count' }.
title / hint / iconReactNode—Content of the zone.
showFilesbooleantrueList chosen files with a remove button.
namestring—Submitted with forms — the input holds every chosen file.

Accessibility

  • A real file input inside a <label>: Tab focuses it, Enter or Space opens the picker, and the hint is linked with aria-describedby.
  • Every chosen file has a labelled remove button. Reduced motion: no splash, swell or shake.