Blazor playground

Nova v3.37.0

Preview

Blazor

Progress bar

nv-progressbar

A slim horizontal bar that shows how far a task has come, with an optional percentage and a colour for its outcome.

Parts

Live demo

Feedback

Overview

Use a progress bar for a task that takes a while and whose progress your application can measure, such as an import or an upload. For a short wait without a measure, a loader is enough. The bar isn't interactive.

Anatomy

A progress bar showing 46%, with three callouts: 1 marks the track, 2 the filled part, and 3 the percentage value.

The parts of a progress bar.
  1. Track: the full width of the task.
  2. Fill: value as a share of max (default 100). Values outside the range are clamped.
  3. Percentage (optional, showValue): the rounded share, such as "75%".

Properties

Design settingCodeMapping
Feedbackfeedbackneutral, success or error; the application sets the outcome.
IndeterminateindeterminateAnimates a segment and hides the percentage. Use with neutral feedback.
Valuevalue, maxThe fill is the clamped ratio of value to max.
Show valueshowValueDisplays a rounded percentage.
Accessible namearia-label, aria-labelledbyIdentifies the task being measured.

Look and feel

Use neutral feedback during work, success after completion, and error when work fails. The design shows a full success track: in this implementation, set value to max as well as feedback="success"; feedback alone changes only the colour. For an error, retain the last measured value.

Indeterminate progress moves a segment along the track for work of unknown duration. It hides the percentage and stops animating under reduced-motion preferences. End indeterminate mode before showing success or error. Both modes support Spark and Ocean in light and dark themes.

neutral · default
showValue
feedback="success"
feedback="error"
indeterminate

Accessibility

Name each bar and provide visible status text so colour does not carry the outcome alone. The host exposes role="progressbar", a minimum of 0 and a maximum of 100; aria-valuenow contains the percentage, regardless of the application's max. It is omitted for indeterminate progress.

Usage

Use measured progress when available. Reaching 100% does not prove that the server accepted the work: set success only after completion is confirmed. Use indeterminate progress only while the result is pending.

Importing readings: 3 of 8 files
DoSay what is happening next to the bar.
Don'tAvoid a bar without text; people can't tell what it measures.

Related

File upload uses the bar inside each file tile. Use a loader when activity needs no progress track.

Sources