ProgressBar

OverviewExamplesPropertiesMethodsCSS PropertiesUsageIntegration

Progress Bar is used to visually represent the completion of a task or process. It shows how much of the task has been completed and how much is still left.

Loading...

Properties

PropertyAttribute Description TypeDefault
valuevalueSpecifies how much of the task has been completed. Must be a valid floating point number between 0 and max, or between 0 and 100 if max is omitted. If there is no value, the progress bar is indeterminate; this indicates that an activity is ongoing with no indication of how long it’s expected to take.number | undefined
maxmaxDescribes how much work the task indicated by the progress element requires. The max attribute, if present, must have a value greater than 0 and be a valid floating point number.number100
labellabelAccessible label for the progress indicator. Visually hidden, but shown for assistive technology.string'Current progress'

Methods

Method nameParameters Description
focus(options?: FocusOptions) => voidoptions: An object which controls aspects of the focusing process.Programmatically move focus to the component.
blur() => voidN/AProgrammatically remove focus from the component.
click() => voidN/AProgrammatically simulates a click on the component.

CSS Properties

CSS Custom Properties provide more fine grain control over component presentation. We advise utilizing existing properties on the component before using these.

PropertyDescriptionDefault
--n-progress-sizeControls the thickness of the progress bar, using our spacing tokens.var(--n-space-s)
--n-progress-border-radiusControls how rounded the corners are, using border radius tokens.var(--n-border-radius-s)
--n-progress-colorControls the color of the progress bar, using color tokens.var(--n-color-accent)

Usage

This section includes guidelines for designers and developers about the usage of this component in different contexts.

Do

  • Use to show the completion status of an ongoing task.
  • Use progress bar when you can determine the percentage of the completed task at any time.
  • Always provide an accessible label when using Progress Bar.

Don’t

  • Don’t use in constrained spaces indicating indeterminate loading state, see Spinner instead.

Integration

For integration guidelines, please see Web Components documentation .

Was this page helpful?

Yes No

We use this feedback to improve our documentation.