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-progressUsage
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
| Prop | Type | Default |
|---|---|---|
files{ id, name, progress (0–100), secondsLeft? }. | UploadFile[] | — |
pausedShows “Paused” instead of the time left. | boolean | false |
onPauseToggleShows the pause / resume button (tap the card to reveal it). | () => void | — |
onCancelShows the cancel button (tap the card to reveal it). | () => void | — |
onMenuPressShows the ⋮ button. | () => void | — |
secondsLeftOverall time left in the compact card. | number | — |
titleTitle while uploading. | string | "Uploading N files" |
doneTitleTitle once finished. | string | "Uploaded N files" |
onCompleteCalled once when every file reaches 100%. | () => void | — |
accentColorProgress line colour. | string | "#8b7cf6" |
fillColorFill sweeping behind the compact card. | string | "#f1f2f5" |