File Upload Pipeline
motiq/file-upload-pipelineFreeComponent
An application-controlled file upload workflow: presents app-supplied upload items with progress, pause/resume/retry/cancel/remove, processing stages, and empty/drag-over/partial-failure/offline states. It never uploads bytes itself unless given an adapter. Status by icon+text; progress announcements throttled.
Live preview
live · rendered by the registry
Rendered by motiq on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://www.motiq.dev/r/file-upload-pipeline.jsonSource
1"use client";23import * as React from "react";4import { motion, AnimatePresence, type Transition } from "motion/react";56import { cn } from "@/lib/utils";7import {8 useReducedMotion,9 useDisclosure,10 useCopy,11 statusVars,12 type StatusTone,13} from "@/lib/motiq";1415/* --------------------------------------------------------------------------16 * FileUploadPipeline — a presentation-only view of an upload queue with17 * per-item progress, pause/resume, retry, cancel, processing stages, and18 * partial-failure handling. It is the *panel*, not the *uploader*.19 *20 * The host APPLICATION owns uploading. This component never opens an XHR/fetch,21 * never reads a File body, and never advances `progress` on its own — it renders22 * the `items` it is given and calls back (`onPause`, `onRetry`, `onAddFiles`, …)23 * so the app can drive the real transfer (or drive nothing, in a static demo).24 * There is no built-in adapter; wiring the component to a transport is the app's25 * job. This keeps it transport-agnostic (fetch, XHR, tus, S3 multipart, RSC26 * actions) and SSR-safe.27 *28 * Accessibility is first-class: a real `<input type="file">` integration point29 * plus a keyboard-accessible Browse button as the drop-zone alternative; every30 * in-flight item exposes `role="progressbar"` with `aria-valuenow/min/max` and a31 * text `aria-valuetext`; status is always conveyed with an icon AND text (never32 * colour alone); errors are associated to their row via `aria-describedby`; and33 * the polite live region announces STATUS TRANSITIONS ONLY — never per-percent —34 * so a screen reader isn't flooded during a transfer. Under35 * `prefers-reduced-motion` rows appear without offset and progress bars snap.36 * Clean-room original.37 *38 * PERFORMANCE. The component performs no per-frame React state updates: bar39 * width is set from the app-supplied `progress` and eased purely in CSS, so a40 * fast upload does not re-render React 60×/s (the app should throttle its own41 * `progress` writes to a few per second). THUMBNAIL CLEANUP is the app's42 * responsibility — if you pass `thumbnail` as an `URL.createObjectURL(...)`43 * blob URL, revoke it when the item leaves `items` (this component does not,44 * because it did not create the URL). For very large queues (hundreds of45 * concurrent items) wrap the list in your own virtualizer — this component46 * renders every item it is given.47 * ----------------------------------------------------------------------- */4849// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from motiq
All 100 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Activity Streamactivity-stream | motiq | Components | Free | 1 dep | |
| Adaptive Safe-Zone Gridadaptive-safe-zone-grid | motiq | Components | Free | no deps | |
| Agent Run Timelineagent-run-timeline | motiq | Components | Free | 1 dep | |
| AI Response Streamai-response-stream | motiq | Components | Free | 1 dep | |
| Animated Accordionanimated-accordion | motiq | Components | Free | 2 deps | |
| Animated Buttonanimated-button | motiq | Components | Free | 1 dep | |
| Animated Dialoganimated-dialog | motiq | Components | Free | 2 deps | |
| Animated Gridanimated-grid | motiq | Components | Free | 2 deps |
