Vacuum File Drop

Motion Components · Vol. 1

Component

Vacuum File Drop

Variants

The same markup works as a compact, plain-CSS drop zone with no WebGL: sizes and states below. Files still queue, validate and list.

Compact
Default: drop files, or press Enter to browse
Disabled

Usage

Paste the markup, include assets/css/tokens.css and assets/css/tailwind.css, then run the script from this page.

Accessibility

  • Role and state. The drop zone is a real button (role="button") that opens a native file picker, so every file can be added without dragging. Results are announced through a polite live region ("2 files uploaded, 1 rejected"). The list is a labelled ul with a Remove button per file.
  • Keyboard. Tab to the drop zone, Enter or Space opens the picker. "Try sample files", Remove and "Empty vacuum" are normal buttons with visible focus rings from the --ring token.
  • Reduced motion. With prefers-reduced-motion the vortex is a still frame, no cards fly: files go straight to the list and the status text says what happened.
  • Validation. Files over 25 MB and executable types (.exe, .bat, .sh, .msi) are rejected with a red error row that names the reason. Color is never the only signal: rejected rows carry the word "Rejected".