Limited supportUse with care and confirm browser support before shipping it to all users.

Overview

The progress() CSS function returns a ratio for the relative position of one value between two other values, clamped between 0 and 1. You can use it to interpolate a value for other calculations. It is useful when you need more deliberate control over presentation or behavior in a focused part of the interface.

Browser support

Feature Desktop Mobile
Chrome
Edge
Firefox
Safari
Chrome Android
Safari iOS
138
138
26
138
26
1+Supported (version) Not supported Has note Sub-feature descriptions sourced from MDN Web Docs (CC BY-SA 2.5)

Syntax

CSS
.bar {
  --value: 75;
  width: calc(progress(var(--value), 0, 100) * 100%);
}

Live demo

75%

CSS 75% demo.

PreviewFullscreen

40%

CSS 40% demo.

PreviewFullscreen

100%

CSS 100% demo.

PreviewFullscreen

Use cases

  • Use progress()

    Use progress() when the default CSS behavior is not expressive enough for the component or layout you are building.

  • Handle edge cases

    Apply progress() to solve a specific styling constraint without introducing broader layout or behavior changes.

Cautions

  • Test progress() in the browsers you support, especially if it changes layout, text handling, or interaction behavior.
  • Plan a fallback or acceptable degradation path when support is still limited.

Accessibility

  • Confirm that using progress() does not make content harder to perceive, understand, or operate in assistive contexts.

Powered by web-features