Component packs › Latch › Gravity Dropzone
A field of dots bends toward a dragged file like a gravity well; dropped files fly into the list with their own progress, and a file that fails crumples and falls out.
Gravity Dropzone is a file upload from Latch, a component pack with 8 components: Form and sign-in components that work like little mechanisms. Price: $2 for the whole pack.
Built with: dot field, per-file progress, crumple on fail.
Code: React and Next.js (TypeScript), Vue 3, plain HTML/CSS/JS, Tailwind CSS v4 and Motion (motion.dev). No npm packages needed. Keyboard accessible, with a reduced-motion version, in dark and light.
| Prop | Type | Default | Description |
|---|---|---|---|
title | string | ||
hint | string | ||
accept | string | File types for the picker, e.g. "image/*,.pdf". | |
maxSize | number | 10 MB | Largest allowed file in bytes. Default 10 MB. |
upload | (file: File, progress: (p: number) => void) => Promise<void> | simulated | Upload one file. Call progress(0..1) as it goes; resolve when done, reject to fail it. Default: simulated. |
onChange | (files: DropFile[]) => void | ||
theme | 'dark' | 'light' | ||
autoplay | boolean | Showcase mode: a ghost file is dragged in and dropped, again and again, until touched. |
readonly files: DropFile[]destroy(): voidimport GravityDropzone from './GravityDropzone';
<GravityDropzone />The Vue, HTML, Next.js, Tailwind and Motion versions take the same options.
Good for: Form and sign-in components.