Skip to content

feat(site): add per-digit pop-in animation for numeric values#26059

Draft
jakehwll wants to merge 2 commits into
mainfrom
jakehwll/number-pop-in-transition
Draft

feat(site): add per-digit pop-in animation for numeric values#26059
jakehwll wants to merge 2 commits into
mainfrom
jakehwll/number-pop-in-transition

Conversation

@jakehwll
Copy link
Copy Markdown
Contributor

@jakehwll jakehwll commented Jun 4, 2026

🤖 This PR was written by Coder Agents on behalf of Jake Howell.

Adds an AnimatedNumber component that renders each character as an individually animated span, sliding up with a bouncy overshoot easing. Integrates it into the usage indicator percentage display.

What changed

New AnimatedNumber component splits a value into characters and animates each one in with animate-in fade-in-0 slide-in-from-bottom-1 using cubic-bezier(0.34, 1.45, 0.64, 1). The last two characters stagger behind the leading ones by 70ms intervals, so trailing digits feel alive without looking chaotic. The animation replays on value change via React key remounting.

Applied to the UsageSection percentage text in UsageIndicator.tsx so the numbers now pop in alongside the existing stroke animation on the usage ring.

Files

File Change
AnimatedNumber.tsx New shared component
AnimatedNumber.stories.tsx Default, Percentage (with randomize), Counter (with +1/+100/reset) stories
UsageIndicator.tsx Replaced {roundedPercent}% with <AnimatedNumber>

Each character slides up and fades in with a bouncy overshoot easing.
The last two characters stagger behind the leading ones. The animation
replays on value change via React key remounting.

Integrates into UsageIndicator percentage display so the usage ring
numbers animate alongside the stroke.
Track a generation counter per character position. Only the positions
where the character actually changed get a new React key, so only
those spans remount and replay the enter animation. Stable digits
stay put.

Add tabular-nums to the wrapper so digit widths are fixed and the
layout does not shift as values change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant