Skip to content

HyProgress

Usage examples on this page are written for Lit / plain HTML (<hy-progress>). The same component ships as HyProgress in @whitespaceux/harmony-react (native React 19), with typed wrappers for Angular, Solid, Svelte, and Vue. The API reference below applies to all frameworks.

A linear progress bar that displays the completion status of a task.

Progress bars show either determinate progress (known percentage) or indeterminate progress (unknown duration). For indeterminate circular loading, use the Spinner component instead.

Key Features:

  • Determinate mode with percentage display
  • Indeterminate mode with animated indicator
  • Three size variants (small, medium, large)
  • Four status variants (default, success, warning, danger)
  • Customizable via CSS custom properties
  • SSR compatible

Accessibility Features:

  • Uses role="progressbar" with proper ARIA attributes
  • aria-valuenow, aria-valuemin, aria-valuemax for determinate
  • aria-label for accessible name when label is not visible
  • aria-labelledby links to visible label when show-value is true
  • aria-busy indicates indeterminate state
  • Warns in console when label attribute is missing
  • High contrast mode support
  • Respects prefers-reduced-motion

When to Use:

  • File uploads/downloads with known progress
  • Multi-step processes
  • Form submission progress
  • Any operation with measurable completion

When NOT to Use:

  • Unknown duration operations (use Spinner or indeterminate mode)
  • Page-level loading (consider Skeleton)
  • Very short operations (no indicator needed)

Examples

Basic determinate progress

html
<hy-progress value="75" label="Upload progress"></hy-progress>

With visible percentage

html
<hy-progress value="50" label="Loading" show-value></hy-progress>

Indeterminate mode

html
<hy-progress indeterminate label="Processing"></hy-progress>

Different sizes

html
<hy-progress value="60" size="small" label="Progress"></hy-progress>
<hy-progress value="60" size="medium" label="Progress"></hy-progress>
<hy-progress value="60" size="large" label="Progress"></hy-progress>

Status variants

html
<hy-progress value="100" variant="success" label="Complete"></hy-progress>
<hy-progress value="80" variant="warning" label="Almost full"></hy-progress>
<hy-progress value="30" variant="danger" label="Low storage"></hy-progress>

Custom max value

html
<hy-progress value="3" max="5" label="Step 3 of 5" show-value></hy-progress>

Custom styling

html
<hy-progress
  value="70"
  label="Progress"
  style="--hy-progress-indicator-color: deeppink;"
></hy-progress>

Circular ring

html
<hy-progress shape="ring" value="70" label="Upload progress" show-value></hy-progress>

API

Properties

PropertyAttributeTypeDefaultDescription
valuevaluenumber0Current progress value.
maxmaxnumber100Maximum value for the progress bar.
sizesize'small' | 'medium' | 'large''medium'Size of the progress bar.
variantvariant'default' | 'success' | 'warning' | 'danger''default'Visual variant indicating status.
indeterminateindeterminatebooleanfalseWhether to show indeterminate (unknown progress) animation.
labellabelstring''Accessible label describing the progress.
showValueshow-valuebooleanfalseWhether to visually display the percentage/value.
shapeshape'linear' | 'ring''linear'Geometry of the progress indicator.

CSS Parts

PartDescription
baseThe component's base wrapper element
trackThe background track element (linear shape)
indicatorThe filled progress indicator (linear shape)
ringThe circular SVG wrapper (ring shape)
label-containerContainer for label and value text
labelThe label text element
valueThe value/percentage text element (centered for the ring shape)

CSS Custom Properties

PropertyDescription
--hy-progress-gapGap between progress bar and label
--hy-progress-gap-labelGap between label elements
--hy-progress-radiusBorder radius of the track and indicator
--hy-progress-track-height-smTrack height for small size
--hy-progress-track-height-mdTrack height for medium size
--hy-progress-track-height-lgTrack height for large size
--hy-progress-bar-colorOverride color for the progress indicator bar
--hy-progress-track-colorBackground color of the track
--hy-progress-enter-durationTransition duration for the determinate value-change animation
--hy-progress-enter-easingTransition easing for the determinate value-change animation
--hy-progress-pulse-durationIndeterminate pulse animation duration
--hy-progress-pulse-easingIndeterminate pulse animation easing
--hy-progress-ring-sizeRing diameter (overrides all sizes at once)
--hy-progress-ring-thicknessRing stroke width (overrides all sizes at once)

Built with Lit. Documented with VitePress.