Mushilu-San UI

Search components

PlaygroundStorybookGitHub
Feedback

Progress

Shows how far along a known task is, as a linear or circular bar.

Selector: mui-progress

Import
import { Progress } from '@mushilu-san/ui/feedback';
PreviewCode

Loading example…

Overview

Progress has role="progressbar" with aria-valuenow from value and aria-valuemax from max. Set label to describe the task, so the bar is announced with a name.

Set indeterminate when the length of the task is unknown. The bar then animates without a value, and the host is marked aria-busy.

When to use

  • Uploads, installs and exports where the percentage is known.
  • Steps in a multi-step process, such as 2 of 5 done.

When not to use

  • An operation with no known progress. Use an indeterminate progress or a spinner. Use Spinner instead.

Examples

Indeterminate

PreviewCode

Loading example…

Guidelines

Do

  • Give label a name for the task, such as "Uploading photos".
  • Update the value as the task moves, not in large jumps.

Don't

  • Do not show a progress bar that never finishes. Add an error state and a way out.

Accessibility

Roles and attributes

ElementRoleNotes
hostprogressbararia-valuenow and aria-valuemax set; aria-valuenow is removed when indeterminate. aria-busy="true" when indeterminate.
  • A progress bar is not interactive. Announce completion with an alert or toast if the user needs to know.

API

Progress

Selector: mui-progress

NameTypeDefaultDescription
valuenumber0 Current value. Clamped between 0 and `max`. Default `0`.
maxnumber100 Value that means complete. Default `100`.
variant'linear' | 'circular''linear' Shape of the indicator: `linear` bar or `circular` ring. Default `linear`.
size'sm' | 'md' | 'lg''md' Indicator size: `sm`, `md` or `lg`. Default `md`.
indeterminatebooleanfalse Shows an animated bar with no value, for tasks of unknown length. Accepts attribute presence, e.g. <… indeterminate>.
labelstring | undefined— Accessible name for the progress bar.

CSS parts

  • ::part(indicator)
  • ::part(root)

Tokens

  • --mui-color-primary
  • --mui-color-border
  • --mui-radius-full
  • --mui-space-2