Ir al contenido
Español
Lista de subidas viene con Pro. La vista previa aparece al desbloquearlo.

Cómo funciona

The list only draws what you give it, so it works with any upload method. Speed is an exponential moving average of the change in loaded, so the time left does not flicker. Names keep their extension visible while the middle part ellipsises. The total ignores failed files, so the header never suggests a finish that will not come.

Úsalo para

  • Uploading several files, or large ones, where people want to see and control each transfer.
  • A tray or panel that stays visible while people keep working.

Busca otra opción cuando

  • One small file that finishes in a second: a spinner in the upload button is enough.
  • Picking files: use an upload or drop zone, then show this list.

Uso

import { UploadProgressList } from './UploadProgressList.jsx'

// files: [{ id, name, size, loaded, status: 'queued' | 'uploading' | 'paused' | 'done' | 'error', error? }]
export function Uploads({ files, queue }) {
  return (
    <UploadProgressList
      files={files}
      onPause={(f) => queue.pause(f.id)}
      onResume={(f) => queue.resume(f.id)}
      onCancel={(f) => queue.cancel(f.id)}
      onRetry={(f) => queue.retry(f.id)}
      onRemove={(f) => queue.remove(f.id)}
    />
  )
}

Propiedades

PropiedadTipoPor defectoQué hace
files{ id, name, size, loaded, status, speed?, error? }[]—One entry per file; size and loaded in bytes. status is 'queued', 'uploading', 'paused', 'done' or 'error'. Pass speed (bytes per second) if you know it; otherwise it is measured from loaded and smoothed.
onPause(file) => void—Shows pause on uploading rows.
onResume(file) => void—Shows resume on paused rows.
onCancel(file) => void—Shows cancel on every unfinished row.
onRetry(file) => void—Shows a labelled Retry button on failed rows.
onRemove(file) => void—Shows remove on finished rows.
showSummarybooleantrueThe header with the count, time left and total bar.
labelsobject—Replaces built-in text and formatters: title, summary(done, total), left(time), of(a, b), speed(s), queued, paused, done, failed, pause, resume, cancel, retry, remove, formatBytes(n), formatTime(s).
...restHTMLAttributes<HTMLDivElement>—Passed to the root.

Accesibilidad

  • Each row's bar is a progressbar named by the file, with aria-valuetext giving percent, size, speed and time left; the total bar is a progressbar too.
  • Icon buttons are labelled with the action and the file name ("Pause site-walkthrough.mp4"); Retry has visible text. All are 32px, 40px on touch.
  • The count of finished files is announced in a polite live region.
  • Status is never colour alone: a badge, words in the meta line and the bar's pattern (striped when paused) change too. Reduced motion stops the sheen and the bar and badge transitions.

Movimiento

Fills glide to each new value in 420ms (cubic-bezier(0.25, 0.8, 0.3, 1)) with a sheen passing every 1.6s while uploading. On completion the fill turns green, the badge pops with a 360ms spring and the bar folds away over 320ms. Rows enter rising 6px over 360ms.

Añádelo a tu proyecto

Los miembros Pro copian un prompt y su agente de programación instala el código, igual que con los gratuitos.

UploadProgressList.jsxupload-progress-list.csstokens.cssREADME.md

Los dos archivos se instalan juntos. La hoja de estilos lee las variables de tokens.css y lleva valores de reserva, así que también funciona sola.

Carga
Revelado de imagen viene con Pro. La vista previa aparece al desbloquearlo.
Cargador orbital viene con Pro. La vista previa aparece al desbloquearlo.