Progress bar

A linear indicator of how far a task or quantity has progressed: an upload, a multi-step setup, a quota. Without a value it shows indeterminate activity.

  • vig-progress-bar
Import
import { ProgressBar } from '@vigdx/ui/progress-bar';

Basic

value is a percentage from 0 to 100 (clamped and rounded). showValue prints it next to the bar; ariaLabel names the bar for screen readers.

Storage used6.8 GB of 10 GB

Variants

variant colors the fill with the shared hues, e.g. success once a task is done or warning and error for a nearly full quota.

Sizes

size sets the track height to sm , md (default) or lg , relative to the font size. The bar fills the width of its container.

Indeterminate

Leave value at null when the remaining work is unknown: a segment sweeps along the track, or the bar stays static with reduced motion.

Preparing your export…

Live progress

Bind value to a signal and the fill animates between updates. Switching the variant on completion confirms the result.

annual-report-2026.pdf

Labels

ariaLabel and valueTemplate ( {0} is the rounded value) are inputs for translations; the template also feeds aria-valuetext . App-wide defaults come from the progressAriaLabel and progressValueTemplate labels.

Styling hooks

Internal elements carry a stable data-part and the component's data-scope; both are public API, so removing one is a breaking change. Select a part by both, e.g. [data-scope="progress-bar"][data-part="track"] { … }: the pair stays within this component when kit components nest, and also reaches parts in overlay panels, which render outside the host. State is exposed through aria-* and, where listed, a data-state; literal values are checked by the API gate, values computed from the component's state follow its documented types. Other data-* attributes listed below (such as data-opening while an overlay animates) are API too. See Customizing.

Scope: [data-scope="progress-bar"]

ProgressBar styling hooks
Part Element data-state
track The native <progress> ; the fill is its pseudo-element. —
value The percentage text ( showValue ). —

Accessibility

  • Renders a native <progress max="100">, which the platform exposes as a progress bar with its value, plus a formatted aria-valuetext; indeterminate bars omit the value.
  • Always give each bar a specific ariaLabel, or point at a visible heading with ariaLabelledby (ariaDescribedby adds a description); the generic default (“Progress”) does not tell users what is progressing.
  • Screen readers do not announce every value change. For long tasks, also announce milestones or completion in a live region such as a toast.
  • The fill animation and the indeterminate sweep respect prefers-reduced-motion: the sweep slows down rather than stopping, so the bar still reads as busy.

API

ProgressBar

vig-progress-bar component

Linear progress indicator: a native <progress>, so the progressbar role and value come from the platform. A value of 0–100 renders a determinate bar; null renders an indeterminate sweep (slowed down, never stopped, with reduced motion, so it still reads as busy).

ProgressBar props
Name Type Default Description
ariaDescribedbystring | undefinedundefined

Ids of elements describing the bar. A static aria-describedby on the host works too.

ariaLabelstring | undefinedundefined

Accessible name; defaults to the progressAriaLabel label.

ariaLabelledbystring | undefinedundefined

Ids of elements naming the bar, e.g. a visible heading; wins over ariaLabel. A static aria-labelledby on the host works too.

showValuebooleanfalse

Renders the formatted percentage next to the bar (determinate only).

sizeProgressBarSize'md'
—
valuenumber | nullnull

Percentage complete (0–100, clamped); null shows an indeterminate bar.

valueTemplatestring | ((value: number) => string) | undefinedundefined

Percentage text: a function of the rounded value, e.g. (n) => n + ' percent', or a string where {0} is replaced with it. Defaults to progressValueTemplate.

variantProgressBarVariant'primary'
—

Are you sure?