UIR

UploadProgress

A compact upload card with a progress fill sweeping behind it. Tap for pause / cancel, expand for a bar per file, and it morphs into a done row when everything reaches 100%. You run the upload; it shows the numbers.

Preview

Preview coming soon

Try it live: run the CLI command below in an Expo app, or open the Code tab.

Installation

npx @codewithrabby/ui@latest add upload-progress

Usage

import { UploadProgress } from "@/components/uir/upload-progress";

// files come from your uploader (progress 0–100)
<UploadProgress
  files={[
    { id: "1", name: "Nature.mp4", progress: 42, secondsLeft: 12 },
    { id: "2", name: "Intro movie.mp4", progress: 80, secondsLeft: 4 },
  ]}
  secondsLeft={12}
  paused={paused}
  onPauseToggle={() => (paused ? uploader.resume() : uploader.pause())}
  onCancel={() => uploader.cancel()}
  onComplete={() => toast.success("Uploaded")}
/>

Props

PropTypeDefault
files

{ id, name, progress (0–100), secondsLeft? }.

UploadFile[]—
paused

Shows “Paused” instead of the time left.

booleanfalse
onPauseToggle

Shows the pause / resume button (tap the card to reveal it).

() => void—
onCancel

Shows the cancel button (tap the card to reveal it).

() => void—
onMenuPress

Shows the ⋮ button.

() => void—
secondsLeft

Overall time left in the compact card.

number—
title

Title while uploading.

string"Uploading N files"
doneTitle

Title once finished.

string"Uploaded N files"
onComplete

Called once when every file reaches 100%.

() => void—
accentColor

Progress line colour.

string"#8b7cf6"
fillColor

Fill sweeping behind the compact card.

string"#f1f2f5"