navius

Progress

Displays an indicator showing the completion progress of a task, typically displayed as a progress bar.

60%

Features

  • Provides context for assistive technology to read the progress of a task.
  • Supports an indeterminate state when Value is null.
  • Validates rather than clamps: a value below 0 or above Max is treated as indeterminate.
  • Exposes data-complete, data-indeterminate, data-progressing, data-value and data-max for styling.

Installation

Install the brain, or copy just this primitive in with the CLI.

Anatomy

Import the parts and assemble them.

API Reference

Contains all of the progress parts. Renders a div with role="progressbar".

Prop Type Default
Value double? null
Max double 100
GetValueLabel Func<double?, double, string?>? -
ChildContent RenderFragment? -
Data attribute Values
[data-complete] Present when the value equals the max
[data-indeterminate] Present when the value is null
[data-progressing] Present while determinate and in progress
[data-value] The current value (absent when indeterminate)
[data-max] The max value

Used to visually show the progress. Renders a div.

Prop Type Default
ChildContent RenderFragment? -
Data attribute Values
[data-complete] Present when the value equals the max
[data-indeterminate] Present when the value is null
[data-progressing] Present while determinate and in progress
[data-value] The current value (absent when indeterminate)
[data-max] The max value

Accessibility

Adheres to the progressbar role requirements. The root sets aria-valuemin, aria-valuemax, aria-valuenow and aria-valuetext from the resolved value, and omits aria-valuenow while indeterminate.

A progress bar is not interactive, so it has no keyboard interactions.