Component packs › Latch › Gravity Dropzone

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.

Gravity Dropzone props

PropTypeDefaultDescription
titlestring
hintstring
acceptstringFile types for the picker, e.g. "image/*,.pdf".
maxSizenumber10 MBLargest allowed file in bytes. Default 10 MB.
upload(file: File, progress: (p: number) => void) => Promise<void>simulatedUpload 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'
autoplaybooleanShowcase mode: a ghost file is dragged in and dropped, again and again, until touched.

Methods on the ref

Use it in React

import GravityDropzone from './GravityDropzone';

<GravityDropzone />

The Vue, HTML, Next.js, Tailwind and Motion versions take the same options.

More in Latch

Good for: Form and sign-in components.