Progress

A linear bar that shows how far a task has got — an upload, an export, an onboarding checklist. Without a value it becomes an indeterminate loading bar.

StableSource

Import

tsx
import { Progress } from "@merid/react";

Examples

Sizes

sm 4px, md 6px (default), lg 8px thick.

Indeterminate

Omit value (or pass null) when the duration is unknown.

Custom max and value text

max changes the scale; valueText replaces the default percentage that screen readers announce.

Updating

Values are clamped between 0 and max. The bar reaches data-state="complete" at 100%.

API reference

Renders a div with role="progressbar"; the ref and other div attributes are forwarded.

PropTypeDefaultDescription
valuenumber | nullnullCurrent value. Omit or pass null for an indeterminate bar.
maxnumber100Maximum value. Non-positive values fall back to 100.
size"sm" | "md" | "lg""md"Bar thickness: sm 4px, md 6px, lg 8px.
valueTextstring–Human-readable value for AT, e.g. "3 of 5 steps". Defaults to the percentage.

Styling

HookValues
.mrd-progressTrack
.mrd-progress__barFilled bar
data-sizesm · md · lg
data-stateloading · complete · indeterminate

Component variables: --mrd-progress-height (set per size) and --mrd-progress-value (the fill percentage, set inline).

Accessibility

  • role="progressbar" with aria-valuemin, aria-valuemax, aria-valuenow and aria-valuetext. In the indeterminate state no aria-value* attribute is set.
  • Always name the bar with aria-label or aria-labelledby — the element has no text of its own.
  • Under prefers-reduced-motion the indeterminate animation is removed.

Guidelines

Do

Use a determinate bar when you can measure progress, and pair it with a visible label of what is happening.

Avoid

Fake progress with a timer that stalls at 99% — use the indeterminate bar or a Spinner.

  • Spinner — compact indeterminate indicator.
  • Skeleton — placeholder while content loads.
  • Stepper — progress through named steps.