Data · bar-race
Bar chart race
Ranked horizontal bars that grow, then re-order smoothly over time as the data steps through keyframes: bars overtake each other, values roll, the leader changes, and a big faded period label (year, quarter) changes behind them.
A free, MIT-licensed animated chart from the Opus Motion Library — 616 motions for Remotion, React and plain HTML.

What Bar chart race is for
Rankings over time: market share by year, top products by quarter, followers by month, league tables, "who is winning" stories. Give the names once and one values row per period in `frames`.
Details
- Category
- Animated charts & data visualisation
- Length
- 8.0 s (240 frames at 30 fps)
- Formats
- 16:9, 1:1, 9:16
- Weight
- light
- Transparent overlay
- yes
- Seamless loop
- no
- Text props
titlesubtitleprefix- Colour props
colorsbackgroundink- Mood
- hud
- Roles
- accent, subject
Use Bar chart race in Remotion, React or HTML
Remotion project
# copy this motion into your Remotion project
node cli/mgl.mjs add bar-race --to ../my-app/src
# render an mp4 (run in the library folder)
node cli/mgl.mjs render bar-race --props '{"title":"Who is growing fastest","subtitle":"Index of weekly active users","prefix":"","colors":["#2F6FED","#FF7A45","#16B39A","#F2B134","#8E5CF0","#E5487F","#5BC0EB","#7A8794"],"background":"#0F1722","ink":"#EEF2F7"}'
# or export for apps / editors: mp4 | webm-alpha | prores-alpha | gif | png | poster
node cli/mgl.mjs export bar-race --as webm-alpha --props '{"title":"Who is growing fastest","subtitle":"Index of weekly active users","prefix":"","colors":["#2F6FED","#FF7A45","#16B39A","#F2B134","#8E5CF0","#E5487F","#5BC0EB","#7A8794"],"background":"#0F1722","ink":"#EEF2F7"}'React / Next.js
import {MotionPlayer} from 'opus-motion-library/web';
<MotionPlayer
motion="bar-race"
props={{
title: 'Who is growing fastest',
subtitle: 'Index of weekly active users',
prefix: '',
colors: [
'#2F6FED',
'#FF7A45',
'#16B39A',
'#F2B134',
'#8E5CF0',
'#E5487F',
'#5BC0EB',
'#7A8794',
],
background: '#0F1722',
ink: '#EEF2F7',
}}
playOnView
loop="auto"
/>Plain HTML / WordPress
<script src="opus-motion.element.js" defer></script>
<opus-motion motion="bar-race"
props='{"title":"Who is growing fastest","subtitle":"Index of weekly active users","prefix":"","colors":["#2F6FED","#FF7A45","#16B39A","#F2B134","#8E5CF0","#E5487F","#5BC0EB","#7A8794"],"background":"#0F1722","ink":"#EEF2F7"}'>
</opus-motion>Compose spec (multi-scene video)
{
"width": 1920,
"height": 1080,
"fps": 30,
"scenes": [
{
"motion": "bar-race",
"props": {
"title": "Who is growing fastest",
"subtitle": "Index of weekly active users",
"prefix": "",
"colors": [
"#2F6FED",
"#FF7A45",
"#16B39A",
"#F2B134",
"#8E5CF0",
"#E5487F",
"#5BC0EB",
"#7A8794"
],
"background": "#0F1722",
"ink": "#EEF2F7"
}
}
]
}Bar chart race props
18 parameters — change any of them to make the motion yours.
| Prop | Default | What it does |
|---|---|---|
names | ["Aurora","Beacon","Cobalt","Delta","Ember","Fjord","Garnet","Harbor"] | one name per bar; colours follow the name index so a bar keeps its colour while it moves |
frames | [{"label":"2019","values":[12,18,9,30,6,14,4,20]},{"label":"2020","values":[20,22,16,34… | keyframes [{label, values[]}] — one values row per period, same order as names |
topN | 6 | how many bars are visible at a time (others slide off the bottom) |
title | "Who is growing fastest" | headline (empty = none) |
subtitle | "Index of weekly active users" | small line under the headline (empty = none) |
prefix | "" | text before every value |
suffix | "" | text after every value, e.g. "%", "M" |
decimals | 0 | decimal places on values |
stepFrames | 34 | frames per keyframe step at speed 1 |
scale | "dynamic" | "dynamic" rescales to the current leader, "fixed" keeps one scale for the whole race |
showRank | false | print the live rank number at the left |
showPeriod | true | big faded period label behind the bars |
colors | ["#2F6FED","#FF7A45","#16B39A","#F2B134","#8E5CF0","#E5487F","#5BC0EB","#7A8794"] | bar palette by name index |
background | "#0F1722" | page colour, or "transparent" |
ink | "#EEF2F7" | text colour |
fontFamily | "" | CSS font family (empty = Space Grotesk) |
startAt | 8 | frame the bars start to grow |
speed | 1 | animation speed multiplier |
Related motions

Donut breakdown
Share-of-total stories on any brand: revenue by channel, budget split, traffic sources, survey answers, market share. Replace data,…
donut-breakdown
Stacked area flow
Composition over time: revenue by product line, traffic by source, energy mix, users by plan, time spent by activity. Replace xLabels and…
stacked-area-flow
Bubble scatter grow
Three-variable comparisons: markets by size, growth and margin, countries, products, campaigns, startups. Pass points as [{label, x, y,…
bubble-scatter-grow
Comparison dumbbell
Change between two states per item: before vs after, last year vs this year, plan vs actual, men vs women, A vs B, scores pre- and…
comparison-dumbbell
Funnel conversion
Sales and signup funnels, hiring pipelines, checkout drop-off, content-to-lead stories, any "how many survive each step" breakdown.…
funnel-conversion
Gantt timeline
Schedules and roadmaps: project plans, launch timelines, sprint plans, production calendars, course or treatment plans. Pass tasks as…
gantt-timeline
Notes & credits
Technique sources:
- original round-3 chart motion