GitHubGitHub
← All components
Feedback / component

Progress

A determinate or indeterminate bar with an optional caption and percentage readout, clamping any value into 0…max.

DeterminateWith valueIndeterminateClamped
<Progress value={62} label="Import progress" showValue />

Installation

pnpm add @chanrg/4ui

Import the stylesheet once, at the root of your app:

import '@chanrg/4ui/styles.css';

Usage

import { Progress } from '@chanrg/4ui';<Progress value={62} label="Import progress" showValue />

Indeterminate

Omit value (or pass null) while the total is unknown; the bar slides and drops aria-valuenow.

<Progress value={null} label="Syncing projects" />

API reference

Props

PropTypeDefaultDescription
valuenumber | nullnullOmit or pass null for an indeterminate bar. Values outside 0…max are clamped.
maxnumber100Upper bound; a non-positive max falls back to 100.
labelstring'Progress'Names the bar and, when rendered, captions it.
showValuebooleanfalseAdds the rounded percentage beside the caption — “—” while indeterminate.

CSS variables

VariableDescription
--4ui-surfacePrimary component surface.
--4ui-textPrimary foreground color.
--4ui-borderDefault control and panel border.
--4ui-trackUnfilled track behind the bar.
--4ui-accentFilled portion of the bar.

Accessibility

  • role="progressbar" carries the name plus aria-valuemin/max/now; the indeterminate bar omits aria-valuenow.
  • The visible caption and percentage are aria-hidden, so the value is announced once rather than twice.
  • Reduced motion replaces the sliding indeterminate bar with a still, dimmed fill.

Dependencies

No runtime component dependencies.