GitHub

Progress Bar

Linear progress indicator with determinate and indeterminate modes, sizes, color variants, and an optional label and percentage.

Stable .astro import EsaProgressBar from '@esa/ecology/esa-progress-bar.astro';

Preview

Uploading 68%
<ProgressBar value={68} label="Uploading" showValue={true} />

Variants

<ProgressBar value={60} variant="primary" />
<ProgressBar value={60} variant="success" />
<ProgressBar value={60} variant="warning" />
<ProgressBar value={60} variant="danger" />

Sizes

<ProgressBar value={50} size="xs" />
<ProgressBar value={50} size="sm" />
<ProgressBar value={50} size="md" />
<ProgressBar value={50} size="lg" />

Label & indeterminate

Add a label (and showValue for the percentage) above the track. Indeterminate mode runs a looping translate animation when the completion is unknown.

Processing 40%
Loading…
<ProgressBar value={40} label="Processing" showValue={true} variant="warning" />
<ProgressBar mode="indeterminate" label="Loading…" />

API

PropTypeDefaultDescription
value number 0 Progress, clamped to 0–100. Ignored in indeterminate mode.
mode 'determinate' | 'indeterminate' 'determinate' Determinate fill vs a looping indeterminate animation.
size 'xs' | 'sm' | 'md' | 'lg' 'md' Track height (2 / 4 / 8 / 12px).
variant 'primary' | 'success' | 'warning' | 'danger' 'primary' Fill color intent.
label string '' Optional text shown above the track; also used as the accessible label.
showValue boolean false Shows the percentage next to the label (determinate only).

Accessibility

  • Renders role="progressbar" with aria-valuemin="0" and aria-valuemax="100".
  • aria-valuenow is set in determinate mode and omitted while indeterminate.
  • aria-label falls back to "Progress" when no label is provided.

Theming surface

Every public token this component reads, extracted from its source at build time. The Resolves to column walks each token's real lineage — component → semantic → primitive → raw value — so you can see exactly where re-pointing it lands. A spoke re-skins by overriding these in its theme-<slug>.css; component internals are never edited. No hook for what you need? File it with /request-lego.

TokenTierResolves to
--progress-bar-fill-bg component #46a758 via --color-primary--color-grass-9
--progress-bar-height-lg component 12px
--progress-bar-height-md component 8px
--progress-bar-height-sm component 4px
--progress-bar-height-xs component 2px
--progress-bar-radius component 9999px via --radius-full
--progress-bar-track-bg component #f0f0f0 via --color-surface-sunken--color-gray-3
--color-danger semantic #e5484d via --color-red-9
--color-success semantic #bdee63 via --color-status-success--color-lime-9
--color-text-primary semantic #202020 via --color-gray-12
--color-text-secondary semantic #646464 via --color-gray-11
--color-warning semantic #ffc53d via --color-status-warning--color-yellow-9
--spacing-100 primitive 0.25rem