Vibary.ai
← Vibe Coding

File Upload Progress

A file row's bar fills as bytes land while the percentage and the counter roll with it.

loadingminimalfriendlyautomatic · finite · starter · ~1.5s
Variant

The animated component in this preview is rendered from the canonical file shown here. The surrounding demo shell only provides context and is not part of the copied code.

337 lines · react + motion only
import { useEffect, useRef, useState } from "react";
import {
  animate,
  motion,
  useMotionValue,
  useReducedMotion,
  useTransform,
} from "motion/react";

About this pattern

The honest version of an upload row. A bar fills from the left while the percentage and the megabyte counter climb beside it, and all three are read off a single motion value, so the number can never disagree with the bar it sits above. The fill is a scaleX rather than a width, which keeps it on the compositor instead of relaying out the row on every frame. When the transfer lands, the readout gives way to a tick that draws itself — a stroke arriving in one motion reads as 'it just finished', where a fade reads as 'it was already done'. The filename and both numbers are text, so they cross-fade and never scale.

Attachment trayDocument uploadMedia importBulk file transfer

Where it shows up

Screens we drew to show where this motion usually sits. Illustrations, not captures of any product.

  • Ridgeline
    Files
    Recent
    Shared
    Starred
    Trash
    FilesNew
    Brand refresh.figPriya Raman · 2.4 MB
    Q3 planning.pdfMarcus Bell · 840 KB
    Supplier contract.docxDana Whitfield · 96 KB
    Photography brief.mdNils Bergström · 12 KB
    Invoice 4821.pdfBilling · 64 KB
    File browser

    Each file's row carries its own bar, and the row settles once the bar completes.

Related patterns