MeDo

Only Show a Percentage You Can Defend.

A progress bar is a promise: this number reflects reality. Describe your upload, import, or multi-step flow and MeDo generates a determinate bar driven by actual events — bytes transferred, rows processed, steps completed — with proper role="progressbar" semantics, an indeterminate variant for when you truly cannot measure, and none of the fake-percent charades that erode trust.

Progress Bar
Progress Bar

A Progress Bar Is a Contract, and Users Audit It

People do not read progress bars passively — they extrapolate. A bar that jumps from 10% to 90% in two seconds then sits there for a minute teaches the user your numbers are fiction, and once that lesson lands they stop waiting for the bar to finish and start refreshing the page. The honesty problem has a precise shape: a determinate bar is only legitimate when you have a measurable denominator — bytes in a file, rows in a CSV, steps in a flow — and the moment you lack one, the correct move is the indeterminate variant or a skeleton, not an invented curve that crawls to 90% and waits. Fake progress is also self-defeating mechanically: to look natural it must move at a plausible rate, which means coding a animation that has no relationship to the work, so it is wrong in both directions — slow when the job is fast, finished-looking when the job is stuck. Wire the number to the event stream and the component does its one job: turning waiting into watching.

4 قالبًا

قوالب Progress Bar التي يمكنك توليدها

كل قالب هو طلب حقيقي لا صورة. انسخه إلى أي محرّر ذكاء اصطناعي، أو شغّله في MeDo لتحصل على كود React و Tailwind مباشرة.

BasicUpload Bar

Live File Upload Progress

Percentage straight from the XHR progress event, tabular-nums readout, and a green completion state. The template every upload form should start from.

Create a single-file upload progress bar bound to real XHR progress events. The track is h-2 rounded-full bg-zinc-200 with an indigo-600 fill whose width equals Math.min(100, Math.round(loaded / total * 100)) from each progress event — no timer-based increments. Show the percentage right of the bar in tabular-nums text-sm, the filename above it, and at 100% transition the fill to green-500 over 300ms and swap the label to an "Uploaded" check. Set role="progressbar" with aria-valuemin, aria-valuemax, aria-valuenow, and aria-valuetext like "64 percent uploaded". Disable the submit button while in flight, and on error freeze the bar at its last value, turn the fill red-500, show the error message, and offer a Retry button that restarts the same upload.

جرّبه في MeDo
BatchMulti-File Queue

File List With Per-File and Total Bars

One bar per file plus an aggregate bar across the whole queue. For media libraries and document drops where users need to see which file is the slow one.

Create a multi-file upload queue where each row shows filename, file size, its own determinate progress bar from that file's XHR events, and a status chip that moves from Uploading to Done or Failed. Upload files with a concurrency of three, so no more than three bars are active at once and the rest read as Queued. Above the list, an aggregate bar sums loaded bytes across all files divided by total bytes of the queue, labeled "3 of 7 files complete". Each bar carries role="progressbar" with live aria-valuenow. A failed file freezes its bar at the last value with a red fill and a Retry control that re-enqueues only that file, while the aggregate bar recalculates its denominator to exclude already-succeeded files.

جرّبه في MeDo
DataImport Wizard

Row-Count Import Progress

For CSV imports and migrations: the fill is driven by processed-row counts reported from the server, with counts spelled out so the number is auditable.

Create a data import progress view driven by server-reported row counts, not client guesses. The client polls a job status endpoint every 800ms and sets the fill width to processedRows over totalRows, showing "1,240 of 5,000 rows" beside the bar in tabular-nums with thousands separators. Update the aria-valuetext to the same phrase. Add a live log region below showing the last three processed batches with timestamps, an ETA in plain words ("about 2 minutes remaining") computed from the trailing 10-second rate, and stage labels that change from Validating to Importing to Finalizing as the server reports them. If polling fails three times, freeze the bar, show "Connection lost — retrying", and resume from the server value on reconnect without resetting to zero.

جرّبه في MeDo
OnboardingStep Completeness

Profile or Setup Completeness Bar

Fills only when the user actually completes steps — computed from state, never from elapsed time. The one progress bar that moves because of the user, not the network.

Create a setup-completeness bar for an onboarding checklist with six steps: add profile photo, verify email, invite a teammate, connect an integration, create a project, complete billing. The fill equals completed steps divided by six, recomputed from application state whenever any step changes, so it never animates on its own. Each completed step ticks from an empty to a checked circle with a 200ms scale transition, and the bar eases its width over 400ms so multi-step completions feel cumulative. Label the bar "Setup 67% complete" with role="progressbar" and matching aria-valuenow and aria-valuetext. Below the bar, surface the single highest-value incomplete step as a clickable suggestion, reordering by a fixed priority, so the bar reads as guidance rather than surveillance.

جرّبه في MeDo

كيف تخصّص Progress Bar الخاص بك

Bind the fill to the event, not the clock

Ask explicitly for the width to derive from the progress event or processed-row count. Any implementation that increments on setInterval is a fake bar with extra steps, and it will drift from reality the first time the network hiccups.

Show numbers next to the bar for long jobs

A bar alone forces users to estimate; a tabular-nums percentage or "1,240 of 5,000 rows" lets them plan. Use tabular figures so the digits do not shuffle sideways on every tick, and update at most a few times per second to avoid render thrash.

Decide the failure state before you ship

The most-designed part of a progress bar is 0 to 100, and the least-designed part is what happens at the error. Ask for a red error state that freezes the fill, keeps the last known value, and offers a retry — a bar that silently resets to zero on failure looks like the work was lost.

Never fake it when the total is unknown

If the API gives no total, use the indeterminate variant and say what is happening in words — "Uploading…". An indeterminate sweep is an admission of ignorance that users forgive; a fabricated percentage that stalls at 87% is a lie they remember.

من يستخدم مكوّن Progress Bar

File upload and media tools

Chunked uploads with a live bytes-transferred percentage per file, a stacked multi-file list where each row has its own bar, and an aggregate bar summing all files in flight.

Data import and migration wizards

Row-count-driven progress during CSV imports or migrations, showing processed counts in words so the user can see the bar is moving at the rate the data actually parses.

Onboarding checklists

A profile-completeness bar that fills as real fields are filled — computed from completed steps divided by total steps, never from time spent, so it only moves when the user does something.

AI generation interfaces

Stage-based progress for model runs — "Queued, Generating, Refining" — where each stage boundary is a real webhook event and within-stage time uses the indeterminate variant instead of an invented percentage.

أنماط Progress Bar لمواقع مختلفة

المكوّن progress bar نفسه، مُهيّأ لنوع الموقع الذي يُنشر عليه.

01 / 04

File Managers and Media Tools

Uploads are the canonical determinate case: bytes are counted by the browser, so any bar that is not showing real transfer progress is throwing away free honesty. Per-file bars plus an aggregate is the shape users expect.

أنماط Progress Bar وتنويعاته

اختر التنويعة التي تناسب بقية الصفحة، ثم ولّدها.

01 / 04

Thin Track Bar

A 6-8px rounded track with a solid fill. The default for embedding beside text or inside form rows — quiet enough to sit next to a filename without becoming the row.

Progress Bar في React و Next.js و Vue و Svelte

React و Next.js و Vue 3 و SvelteKit و Astro أو HTML صِرف — المكوّن progress bar نفسه بست طرق للإضافة.

01 / 03

React Upload Progress Bar

The whole state loop is the XHR progress event. Note the aria-valuetext — screen-reader users need the phrase, not just the number — and the error branch that freezes rather than resets.

src/components/UploadProgress.tsx

const [pct, setPct] = useState(0)

const xhr = new XMLHttpRequest()
xhr.upload.onprogress = (e) => {
  if (e.lengthComputable) {
    setPct(Math.round((e.loaded / e.total) * 100))
  }
}

<div
  role="progressbar"
  aria-valuemin={0}
  aria-valuemax={100}
  aria-valuenow={pct}
  aria-valuetext={`${pct} percent uploaded`}
  className="h-2 rounded-full bg-zinc-200"
>
  <div
    className="h-2 rounded-full bg-indigo-600 transition-[width]"
    style={{ width: `${pct}%` }}
  />
</div>

كيف تضيف Progress Bar إلى مشروعك

أربع خطوات، من اختيار قالب progress bar إلى إطلاقه في الإنتاج.

01~1min

Find Your Denominator

Decide what the percentage is of — bytes, rows, steps — and confirm your stack can actually observe it. If it cannot, plan the indeterminate variant now instead of retrofitting a fake number later.

02~10s

Copy the Prompt

Take a template prompt into MeDo and name your real event source: XHR upload progress, a polling endpoint, a checklist in state. The event source determines the whole implementation, so say it explicitly.

03~1min

Generate and Refine

You get React + Tailwind with a live preview. Refine conversationally — "show rows remaining instead of percent", "freeze and go red on error", "add an aggregate bar across the queue" — rather than editing the width binding by hand.

04~3min

Test the Ugly Paths

Throttle the network and watch for stalls, kill the connection mid-upload, and submit a zero-byte file. The bar must freeze at its last value on failure, recover without resetting to zero, and never divide by a missing total.

أسئلة شائعة حول Progress Bar

How do I show real upload progress instead of a fake animation?

Bind the fill width to the upload event stream: with XHR use the progress event's loaded and total properties, and with fetch use a streaming body reader or chunked upload acknowledgments. If your stack only offers fetch without upload progress, split the file into chunks and count acknowledged chunks, or fall back to the indeterminate variant. The prompt templates here compute the percentage as loaded over total on every event — nothing increments on a timer.

Is it ever okay to use a fake progress bar?

Almost never, and the classic justification — "users just want to see movement" — does not survive contact with a stalled bar at 90%. The single defensible case is a short visual smoothing on top of real data, such as easing the fill between genuine event ticks so it does not stutter. What is not defensible is inventing a curve when you have no denominator: use the indeterminate variant and describe the stage in words, which is honest and, unlike a fake percentage, cannot be caught lying.

When should I use a progress bar instead of a spinner or skeleton?

Use a determinate progress bar when completion is measurable — bytes, rows, steps. Use a skeleton when the structure of the result is known but completion is not, such as a feed loading from an API. Use a spinner for short, unmeasurable actions like form submissions. The failure mode to avoid is a spinner doing a bar's job: a two-minute import shown as a spinning circle gives the user no idea whether they are ten seconds or ten minutes from done.

What ARIA attributes does an accessible progress bar need?

role="progressbar" with aria-valuemin and aria-valuemax, and aria-valuenow updated as it advances. For long jobs add aria-valuetext with a human phrase such as "1,240 of 5,000 rows processed", because a bare number gives screen-reader users no basis to judge the wait. An indeterminate bar omits aria-valuenow entirely and should sit in a region labeled with what is happening, since the animation carries no information to non-visual users.

How do I handle a multi-stage process where each stage has different progress?

Two workable patterns: a single bar whose denominator is the total work across stages, with stage labels swapping underneath, or a step indicator showing completed stages plus an indeterminate bar inside the active one. What breaks is resetting a single bar to zero at each stage boundary — users read that as starting over. If stage weights are unknown, prefer the step indicator; never distribute percentages across stages evenly just to avoid the question.

بناء progress bar الخاص بك الآن.

جرّب أي أمر — مجاني وبدون تسجيل.