Map and motion
Progress bars
A bar that fills from 0 and numbers that count up from 0 when they scroll into view. Works with GSAP; without it the final values show.
Examples
Single bar
Profile complete72%
Set the width with --w. data-progress makes it grow from 0. data-count counts the number up.
Brass fill
Listing views goal1,850 views
.is-brass changes the fill color. data-animate-duration sets the seconds.
List with values
- Harbour Point $1.24M+4.1%
- Lakeside $845K+3.2%
- Northfield $612K+2.4%
Give each row a bigger data-animate-delay to start the bars one after another.
Classes and attributes
| Name | Purpose |
|---|---|
.progress-track | The grey track. .progress-track--lg makes it thicker. |
.progress-fill | The colored fill. Width comes from style="--w: 72%". .is-brass for brass. |
.progress-head | Label on the left and value on the right, above a single bar. |
.progress-list, .progress-row | Card with several rows: .progress-label, a track and .progress-value. |
data-progress | On the fill: grows from 0 when scrolled into view (scaleX only). |
data-count="1.24" | On a number: counts up from 0. Optional data-count-prefix, data-count-suffix, data-count-decimals. |
data-animate-delay, data-animate-duration | Seconds. Defaults: bars 1.4, numbers 1.6. |
Load GSAP, ScrollTrigger and animations.js on the page (see the Animations page). Write the final number inside the element: it is what visitors see without JavaScript or with reduced motion.