moduix

Progress

Displays the status of a task that takes a long time.

API Reference

Original primitive API

Behavior, accessibility details, and low-level props are documented by Base UI.

Base UI API

Basic

Export data
x
import {  Progress,  ProgressLabel,  ProgressValue,} from "moduix";export function ProgressDemo() {  return (    <Progress value={24}>      <ProgressLabel>Export data</ProgressLabel>      <ProgressValue />    </Progress>  );}

Full list of component variables available for project-level overrides.

PropertyDefaultDescription
--progress-colorvar(--color-foreground)Controls the default progress text color.
--progress-gap0.5remControls spacing between progress slots.
--progress-indicator-bgvar(--color-primary)Controls indicator background color.
--progress-indicator-indeterminate-animationprogress-indeterminate 1.5s ease-in-out infiniteControls indicator animation in indeterminate state.
--progress-indicator-indeterminate-width35%Controls indicator width in indeterminate state.
--progress-indicator-transitionvar(--transition-default)Controls indicator width transition.
--progress-label-colorvar(--progress-color)Controls label text color.
--progress-label-font-sizevar(--text-sm)Controls label font size.
--progress-label-font-weightvar(--weight-regular)Controls label font weight.
--progress-label-line-heightvar(--line-height-text-sm)Controls label line height.
--progress-track-bgvar(--color-muted)Controls track background color.
--progress-track-border-colorvar(--color-border)Controls track border color.
--progress-track-border-widthvar(--border-width-sm)Controls track border width.
--progress-track-height0.5remControls track height.
--progress-track-radiusvar(--radius-full)Controls track corner radius.
--progress-value-colorvar(--progress-color)Controls value text color.
--progress-value-font-sizevar(--text-sm)Controls value font size.
--progress-value-font-weightvar(--weight-regular)Controls value font weight.
--progress-value-line-heightvar(--line-height-text-sm)Controls value line height.
--progress-width12remControls the root progress width.

Interactive variables scoped for docs preview without changing size scale tokens.

PropertyValueDefaultDescription
--progress-colorvar(--color-foreground)Controls default text color.
--progress-indicator-bgvar(--color-primary)Controls indicator color.
--progress-track-bgvar(--color-muted)Controls track background.
--progress-track-border-colorvar(--color-border)Controls track border color.
--progress-track-height0.5remControls track height.
--progress-track-radiusvar(--radius-full)Controls track radius.

Anatomy

Progress groups the text label, formatted value, and visual bar for one long-running task. The bar structure is rendered automatically so consumers only compose the visible text slots.

Progress[value]
├─ ProgressLabel
├─ ProgressValue
└─ track
   └─ indicator
import { Progress, ProgressLabel, ProgressValue } from 'moduix';

export function ProgressDemo() {
  return (
    <Progress value={24}>
      <ProgressLabel>Export data</ProgressLabel>
      <ProgressValue />
    </Progress>
  );
}
PartRole
ProgressRoot state machine. Controls value, min, max, formatting, and accessible progress attributes.
ProgressLabelOptional text label associated with the progress root.
ProgressValueOptional formatted value text. It can render the default formatted value or use a child render function.
trackInternal visual rail rendered by Progress. Customize it with CSS variables or classNames.track.
indicatorInternal filled bar rendered inside the track. Customize it with CSS variables or classNames.indicator.

Progress does not expose ProgressTrack or ProgressIndicator in the public composition. Use the default internal bar for normal cases and reach for classNames only when slot-level track or indicator styling is needed.

Composition

Use value={null} for indeterminate work, or pass a number with optional min and max for known progress. locale, format, aria-valuetext, and getAriaValueText come from the root and keep the visual value and accessibility text aligned.

Style the root with className. Style the automatically rendered visual bar with CSS variables, or pass classNames={{ track, indicator }} when the track or indicator needs its own selector. ProgressLabel and ProgressValue remain regular visible slots and accept their own className and render props from Base UI.

Examples

Controlled

Keep the value in React state when progress mirrors another control, upload, export, or background task.

Upload status
x
import {  Progress,  ProgressLabel,  ProgressValue,} from "moduix";import { useState } from "react";export function ControlledProgressDemo() {  const [value, setValue] = useState(45);  return (    <div>      <Progress value={value}>        <ProgressLabel>Upload status</ProgressLabel>        <ProgressValue />      </Progress>      <input        type="range"        min={0}        max={100}        value={value}        onChange={(event) => {          setValue(Number(event.target.value));        }}      />    </div>  );}

Min Max Range

Use min and max when the current value belongs to a custom range instead of the default 0 to 100.

Requests per minute
x
import {  Progress,  ProgressLabel,  ProgressValue,} from "moduix";export function MinMaxRangeProgressDemo() {  return (    <Progress value={420} min={200} max={800}>      <ProgressLabel>Requests per minute</ProgressLabel>      <ProgressValue />    </Progress>  );}

Locale And Format

Use locale, format, and a custom ProgressValue child function to format progress text for users.

Storage usage
x
import {  Progress,  ProgressLabel,  ProgressValue,} from "moduix";export function LocaleAndFormatProgressDemo() {  return (    <Progress value={0.64} min={0} max={1} locale="de-DE" format={{ style: "percent" }}>      <ProgressLabel>Storage usage</ProgressLabel>      <ProgressValue>{(formattedValue) => `${formattedValue} belegt`}</ProgressValue>    </Progress>  );}

Indeterminate

Pass value={null} when the task is running but the current completion percentage is unknown.

Preparing report
x
import {  Progress,  ProgressLabel,  ProgressValue,} from "moduix";export function IndeterminateProgressDemo() {  return (    <Progress value={null}>      <ProgressLabel>Preparing report</ProgressLabel>      <ProgressValue>{() => "In progress"}</ProgressValue>    </Progress>  );}

Aria Value Text

Use aria-valuetext when the numeric value needs a more descriptive accessible label.

Onboarding
x
import {  Progress,  ProgressLabel,  ProgressValue,} from "moduix";export function AriaValueTextProgressDemo() {  return (    <Progress value={3} min={0} max={5} aria-valuetext="Step 3 of 5 completed">      <ProgressLabel>Onboarding</ProgressLabel>      <ProgressValue>{() => "Step 3 of 5"}</ProgressValue>    </Progress>  );}

Custom Value Text

Use getAriaValueText with custom rendered value text when visual and accessible wording should stay aligned.

Migration
x
import {  Progress,  ProgressLabel,  ProgressValue,} from "moduix";export function CustomValueTextProgressDemo() {  return (    <Progress      value={68}      getAriaValueText={(formattedValue) => `${formattedValue} of task completed`}    >      <ProgressLabel>Migration</ProgressLabel>      <ProgressValue>{(formattedValue) => `${formattedValue} done`}</ProgressValue>    </Progress>  );}

Custom Styles

Progress renders the track and indicator automatically. Use className for the root and classNames for the internal track or indicator slots.

Monthly export
x
import {  Progress,  ProgressLabel,  ProgressValue,} from "moduix";import styles from "./progress-demo.module.css";export function CustomStylingProgressDemo() {  return (    <Progress      value={72}      className={styles.customProgress}      classNames={{ track: styles.customTrack, indicator: styles.customIndicator }}    >      <ProgressLabel>Monthly export</ProgressLabel>      <ProgressValue />    </Progress>  );}
.customProgress {  --progress-width: 16rem;  --progress-track-height: 0.75rem;  --progress-track-bg: var(--color-accent);}.customTrack {  box-shadow: inset 0 0 0 var(--border-width-md)    color-mix(in oklab, var(--color-primary), transparent 75%);}.customIndicator {  background: linear-gradient(90deg, var(--color-primary), var(--color-chart-2));}

On this page