Skip to Content

Progress

A brandless progress bar wrapping a <progress> element. All visual styling — fill color, track color, height, border-radius — is driven by CSS custom properties.

Demo

Usage

import { Progress } from '@froglet/ui' // Determinate — 60% complete <Progress value={0.6} max={1} /> // Indeterminate — omit value <Progress max={1} /> // Themed <Progress className="progress--primary" value={0.75} max={1} />

Props

PropTypeDefaultDescription
valuenumberCurrent progress (0 to max). Omit for indeterminate.
maxnumber1Maximum value.
classNamestringAdditional CSS classes. Use to apply a token block.
refReact.Ref<HTMLProgressElement>Forwarded to the underlying <progress>.

CSS Custom Properties

TokenDefaultDescription
--progress-width100%Track width.
--progress-height0.5remTrack height.
--progress-border-radius9999pxTrack and fill corner rounding.
--progress-background-colorCanvasTrack (unfilled portion) background.
--progress-fill-colorcurrentColorFill color.
--progress-border-width0Optional border width on the track.
--progress-border-stylesolidBorder style.
--progress-border-colorBorder color. No border when unset.

Notes

  • Cross-browser styling uses vendor-prefixed pseudo-elements: ::-webkit-progress-bar (track), ::-webkit-progress-value (fill), ::-moz-progress-bar (fill).
  • Passing no value renders the indeterminate state. With appearance: none, the native animation is stripped — add a CSS animation via a modifier class if needed.
Last updated on