Spring Bars
Bars spring up with overshoot, one gradient bar highlighted under a 3.4x stat. A free, MIT-licensed Remotion number animation.
$ pnpm dlx shadcn@latest add @remocn/spring-barsUsage
// src/Root.tsx
import { Composition } from "remotion";
import { SpringBars } from "@/components/remocn/spring-bars";
const SpringBarsScene = () => (
<SpringBars
values={[0.58, 0.72, 0.52, 0.66, 0.97, 0.62, 0.7]}
accentIndex={4}
value="3.4×"
caption="Least sag under the same load"
/>
);
export const RemotionRoot = () => (
<Composition
id="SpringBars"
component={SpringBarsScene}
durationInFrames={320}
fps={60}
width={1280}
height={720}
/>
);Bars drop in as coiled springs and compress to their heights with a bounce, then the chart morphs so the highlighted bar becomes a gradient hero under its stat and caption. Pass values (relative heights from 0 to 1), accentIndex, value and caption. Ships dark and light via theme.
Props15
| Prop | Type | Default |
|---|---|---|
| values | number[]— Relative bar heights from 0 to 1; defaults to seven bars. | |
| accentIndex | number4 Index of the bar that becomes the hero. | |
| value | string"3.4×" The hero stat, such as 3.4x. | |
| caption | string"Least sag under the same load" Line under the hero stat. | |
| stagger | number3 Frames between springs as the weights drop. | |
| coils | number11 Zigzag turns in each spring. | |
| accent | string"#3B5BFD" Accent color for the hero element. | |
| ink | string— Text color; overrides the theme ink. | |
| background | string— Background fill; pass "transparent" to drop it. | |
| fontFamily | string"Schibsted Grotesk" Typeface for the copy. Load the font in your project first. | |
| scale | number1 Size of the foreground around the frame's center; the background stays put. | |
| delay | number0 Frames to hold the first frame before anything moves. | |
| grain | booleantrue Film grain over the scene. | |
| theme | "dark" | "light""dark" Dark or light palette. | |
| speed | number1 Playback multiplier. | |
- valuesnumber[]
Relative bar heights from 0 to 1; defaults to seven bars.
- accentIndexnumber
Index of the bar that becomes the hero.
Default
4 - valuestring
The hero stat, such as 3.4x.
Default
"3.4×" - captionstring
Line under the hero stat.
Default
"Least sag under the same load" - staggernumber
Frames between springs as the weights drop.
Default
3 - coilsnumber
Zigzag turns in each spring.
Default
11 - accentstring
Accent color for the hero element.
Default
"#3B5BFD" - inkstring
Text color; overrides the theme ink.
- backgroundstring
Background fill; pass "transparent" to drop it.
- fontFamilystring
Typeface for the copy. Load the font in your project first.
Default
"Schibsted Grotesk" - scalenumber
Size of the foreground around the frame's center; the background stays put.
Default
1 - delaynumber
Frames to hold the first frame before anything moves.
Default
0 - grainboolean
Film grain over the scene.
Default
true - theme"dark" | "light"
Dark or light palette.
Default
"dark" - speednumber
Playback multiplier.
Default
1