Number roll
Numbers that change like an odometer: every digit rolls in the direction the number moved.
Used forPricing pagesLive dashboardsLanding page statsCountdowns and timers
Install with the shadcn CLI
Registered the namespace? Then it’s shadcn add @hairline/number-roll. Set it up
Templates
Need the whole page?
63 Next.js landing pages, each designed from scratch. Try any of them live; one is $39, all of them $159, and 8 are free.
Where it’s used
Pricing pages
Prices that roll when someone switches between monthly and yearly billing.
Live dashboards
Metrics that change while people are looking at them.
Landing page stats
Numbers that count up when they scroll into view.
Countdowns and timers
Seconds and minutes that roll back like a clock.
What it handles for you
A number that jumps from one value to the next throws away the most satisfying moment on the page. This rolls each digit the way the number actually moved, and many other components in the library are built on it.
It rolls the way it moved
Going up, a 9 rolls on to 0 rather than spinning back down. Unchanged digits stay perfectly still.
Places that open and fold away
999 becoming 1,000 opens a new digit and a comma in front of you.
Any format Intl.NumberFormat supports
Currency, percent, decimals, compact numbers like 9.4K, and grouping in any locale.
Count up from a start
Set from, and it starts there and rolls to the real value as soon as it is painted.
Countdowns that read like a clock
direction="down" makes 00 roll back to 59 instead of spinning forward.
Real text underneath
Screen readers, search and copy and paste get the full number. Digits use tabular figures so nothing shifts sideways.
Overview
A number that jumps from one value to the next throws away the most satisfying moment on the page. Here each digit is its own column and rolls to its new value, the way the number actually moved: going up, a 9 rolls on to 0 rather than spinning back down. New places slide open from nothing and lost places fold away, so 999 becoming 1,000 grows a digit and a comma in front of you. It formats with Intl.NumberFormat, so currency, percent, decimals and compact numbers all roll.
States
- rolling
- Each changed digit rolls up or down with the number, easing out over 0.9s; unchanged digits stay perfectly still.
- growing
- A new place (and its comma) slides open from zero width, and its digit rolls up from 0.
- shrinking
- A place that is no longer needed folds to nothing on the left.
- from
- With from, it starts at that value and rolls to the real one as soon as it’s painted, e.g. stats from 0.
Usage
Works with
Built on it
- Notification bellA bell that behaves like one: each notification hits it, a burst rings harder, and the clapper lags behind on its own.
- FolderA project tile that holds your actual files: it opens on a hinge, fans real sheets, and takes a dropped file with weight.
- ReactionsEmoji reactions for comments and messages: press, slide along the tray and let go, and the emoji flies into its chip.
- Page outlineA spring-guided hairline table of contents and collapsible reading progress pill whose active indicator glides smoothly along a continuous stepped SVG path.
- Spending ringWhere the money went, and what is inside it: thick tiles with their amounts on them, and a category that blooms open into a ring of its own.
- Pay buttonThe button at the end of a checkout, through the whole wait: the card being charged, a line of light while it pays, and a receipt that slides out from under it.
- Lens barsA whole year of days in one card, and a lens to read them: the bars under the pointer spread apart and widen, so any one day out of 365 is easy to land on.
- Threshold lineSet an alert by seeing what it would have done: drag a line across the last 30 days and every day over it turns red while the count of alerts rolls.
- Compare barsThis period, and with one press the one before: every bar splits in two, then what was gained turns green and what fell short shows in red.
- Share barParts of a whole as one bar that comes apart into a ranked list: each segment drops out and slides into its own row, keeping its width.
- Range brushPick a stretch of days by holding it: a lit window over a year of hairlines that glides when thrown, stretches from either edge and settles on whole days.
- PaceA goal for the month and whether you will make it: the running total climbs toward a goal line, the rest of the month is drawn at this pace, and the verdict says when.
- Dot meterSeveral goals at once, each a small field of dots that pours in like grains: protein, carbs and fat, or seats, storage and API calls.
- Balance meterWhat came in against what went out, and the net on a scale of hairline ticks whose needle swings and settles like a scale’s pointer.
- Liquid logThe card is the vessel you log into: tap + and a drop falls into a live surface, the ripple runs to the walls, then the level rises.
- Streak chain“Don’t break the chain”, drawn big enough to care: today’s ring hangs open until you complete it, then it closes, fills with colour and the chain grows a ring.
- Token bucketA rate limit you can watch refill: tokens grow at the real rate, requests take them, and waiting requests are carried off as each new one forms.
- Goal tapeHow far to free shipping, and the moment you get there: the fill runs into a satin ribbon stretched across the bar at the goal and bows it until it snaps.
- LassoSelect a loose group by drawing round it: let go and the band pulls tight like an elastic round exactly what it caught, bending in round what it didn’t.
- Scene mixerA few levels and the scenes that set them: press a scene and a soft veil of light drifts across the card while every level glides to its place.
- Pillar chartA period of activity as glass pillars on dark lacquer: point at one and it turns white, switch the range and the new pillars rise in a wave.
- Mist revealThe calm wait for a generated image: fog drifts through the frame while it works, then the mist moves off and the picture sharpens into place.
- Grain revealA generated image gathers from grains of its own colours, centre first, and locks sharp. Sand away, in reverse.
- Film developA generated image comes up like a print in the tray: a soft field of its colours, then pools of focus opening through it.
- Reeded revealA generated image seen through reeded glass: each reed bends its slice, then the glass clears from the centre outward.
- Floating button groupFloating canvas toolbar: one indicator thrown to the active tool, a zoom stepper whose value rolls, and a menu that grows out of its chevron.
- TextareaA text box that eases to the height of what you write, scrolls with its own thin thumb and faded edges, and turns into a composer with tools, a send button and ⌘↵.
- Multi-selectSeveral choices from a short list: the pill names them ("Design, Sales +2"), the list rises off it with ticks that draw, and it stays open while you pick.
- Time pickerType “9:30 pm” or fling the hour, minute and AM/PM drums; both paths settle into one plain HH:mm value.
- Currency inputA locale-aware money field with caret-safe typing, currency formatting, keyboard steps and clean numeric values for your backend.
- Rating inputWhole or half-star ratings with hover previews, rolling values and native radio behaviour for keyboards, forms and screen readers.
- BadgeA status, a tag or a count: statuses ease their colour and morph their word, live dots breathe, counts roll and fold away at zero.
- AvatarA face, or initials until there is one: the photo rises out of a blur once it has loaded, and a stack of avatars fans open when you point at it.
- ProgressHow far along, as a bar or a ring: the fill eases to each value, the percent rolls, and at 100 it turns green and a check draws itself.
- Shortcut sheetA searchable keyboard shortcuts reference and modal with live physical keycap lighting, chord and sequence matching and OS-aware glyphs.
- TabsViews of one thing: the underline or pill is thrown to the new tab, the panel slides in from the side you moved toward, and counts roll.
- PaginationPages of a long list: the current-page mark is thrown to the new number, and in a narrow container it becomes "3 of 12" with a number that rolls.
- StepsWhere you are in a flow: the line to the next step fills along its length, the finished number blurs into a drawn check, and phones get "Step 2 of 4".
- Pricing toggleMonthly or yearly: the thumb slides with a little give, and every price on the page rolls to its new amount.
- Waitlist fieldAn email field that becomes its own answer: the button stretches across it, then settles as "You’re on the list · #1,248".
- Code inputThe six boxes, done properly: digits rise in, a paste cascades, a wrong code shakes and clears, the right one becomes a pill with a check.
- Steps formA multi-step form in one card that changes shape: steps slide in from the way you’re going, checks shake and explain, and Create turns into what comes next.
- Date range pickerA range is one liquid band: it follows your pointer between days, presets flow it to their span, and the dates morph as it moves.
- Scroll storyA how-it-works section that tells itself as you scroll: steps light up at the middle, a rail fills, and one card reshapes into each step’s picture.
- Stats bandNumbers that arrive when you do: hairlines draw themselves, then each figure rolls up from zero in turn.
- Expanding galleryAn image opens from its exact place in the grid, becomes a spacious viewer, and finds its way back.
- Card deckA tactile stack that fans out, follows your hand, and deals the next card with a measured flick.
- Workflow canvasConnected steps you can move, inspect and follow as work flows through them.
- Magnifying dockA dock that makes room for the tool you reach for, then opens it in place.
- Drop zoneA considered file uploader. Clear actions, quiet progress and useful feedback.
- Drop zone · MembraneA drop zone whose border is a membrane: it reaches for the file, holds it, swallows it and passes it through to its row.
- Morphing chartBars, line and area as one set of marks: bars condense into beads, a thread is strung through them, the fill pours down. Drag the switch to scrub it.
- Range rulerTwo hairline needles across a graduated scale. Thumbs glide without layout thrash and repel each other on contact.
- Ratio balancerA multi-segment allocation track. Drag dividers to rebalance constrained percentages with zero initial jump.
- Tag inputThe invite field, done properly: typed letters grow a chip round themselves, pasted lists spill out of the caret, and a duplicate flies into its twin.
- Avatar cropperThe profile photo field without a modal: the avatar itself grows into the crop, and shrinks back with the face you framed.
- Week calendarA scheduling week you hold in the hand: drag a slot into an event while its times roll, and anything it lands on eases aside.
- Inline editRename a title, a project or a row where it stands: the text becomes the field without moving a pixel, and saves itself.
- ComboboxPick one or several from a list your server searches: results morph between queries instead of flashing, and picks fly into chips.
- Cron inputA schedule field people can read: cron or plain English in, the meaning in words and the next runs out, with clock changes flagged.
- Weekly hoursA recurring Mon to Sun operating and availability hours editor with split shifts, aligned 24-hour coverage bars, overlap guards and Copy to Mon-Fri.
- JSON inspectorRead, search and quote a webhook payload or an API response, or see exactly what changed between two versions of a record.
- Stepper inputA tactile incrementer: tap to step, hold to accelerate, bounds give an elastic bumper shake, and digits roll in place.
- Data tableA table whose rows travel: sort and every row glides to its rank, live data re-ranks itself, and selection turns the toolbar into its actions.
- Kanban boardA pipeline you rearrange by hand: the card becomes the stage it's over while still in the air, and every column's total rolls as it passes.
- Filter barThe bar above a list, done like Linear’s: one panel from property to value, chips you change in place, and a sentence that becomes filters.
- Doc commentsReview threads beside the text they quote: the one you choose lines up with its line, and the rest make way.
- API keysThe API keys screen, done properly: the secret rises in once, and Done folds it down into the "sk_live_••••4f2a" it leaves behind.
- Env editorA structured .env and secrets editor with multi-line .env bulk paste, automatic 8×8 Bayer secret veiling, copy-while-veiled, duplicate key checks and Prod/Prev/Dev scopes.
- Backup codesA 2FA recovery codes panel with 1.5px 8×8 Bayer secret veiling, copy-while-veiled, .txt export, used-code audit stamps and inline regeneration.
- IP allowlistA CIDR and firewall allowlist editor with IPv4/IPv6 validation, live subnet host counts, wildcard exposure guards, containment checks and bulk paste.
- Team membersSettings → Members, done properly: invited addresses fly out of the field onto their rows, role pills grow into the list of roles, and seats roll.
- Settings formA settings page that saves the way people expect: switches save themselves, text edits gather into one bar that rises with "2 unsaved changes".
- Auth cardSign-in that asks one thing at a time: the email field shrinks into a chip round the address, and your server decides whether a password, a code or a link comes next.
- Sudo gateWrap any dangerous button. A padlock on its corner shows how long you stay verified; when it’s locked, the button grows right where it stands into the “Confirm it’s you” card.
- WebhooksSettings → Webhooks, done properly: "Send test" runs a bead down the wire to the endpoint and back in the answer's colour, and every delivery opens into its request and response.
- Domain connectA custom domain from typed to live: copyable records that tick green as DNS finds them, checks that wait longer each time, and a rail that runs to Live.
- Log streamA live tail you can actually read: scroll up and it lets go while a "↓ 128 new" pill counts what arrives, with pause, level counts, search and lines that open into their fields.
- Job queueA worker pool’s jobs grouped by what needs you: reviews first, each job’s status ring doubling as its clock, approvals and retries that call your server.
- CSV importContacts → Import, done properly: your file's columns thread themselves to your fields, bad cells become fields you fix in place, and the rows go to your server in batches.
- Notification inboxThe bell, done properly: its own circle grows into the inbox, new notifications swing it and roll the count, and read ones fold out of Unread.
- IntegrationsSettings → Integrations, done properly: Connect waits on the provider's own window, then folds away as the account it connected opens in its place.
- Status barsA status page that reads at a glance: ninety days a service drawn up bar by bar, one card that glides between them, and incidents whose updates open in as they're posted.
- Live activityOne pill for whatever is happening now: it updates in place, tap it and it grows into a panel, done blurs into a check.
- Pricing calculatorDrag to your size and watch the price roll, the plan morph and, at the top, “Let’s talk”.
- Onboarding checklistThe first five things, ticked off in place: a ring that fills, checks that draw, and a finish worth seeing.
- Sortable listDrag to reorder and everything moves: rows slide out of the way, the dropped one settles, every rank rolls, and presets re-sort the lot.
- Changelog timelineWhat shipped, drawn as you read: a rail that fills, dots that light, filters that fold the rest away.
- Changelog traceWhat shipped, routed like a circuit: the line steps aside between releases, and a bead runs down it as you read.
- Changelog scrubberYour release history on a ruler you scrub: drag the playhead, or press play and watch the product ship.
- Newsletter footerA footer that’s still alive: a signup that becomes its own confirmation, drawn link underlines and your name in outline.
- Prompt composerThe input that starts it all: grows as you type, takes files, and turns Send into Stop while answering.
- Agent composerThe taller composer for agent surfaces: branch, folder and context on a tab above, permissions and model as pills that grow into their lists.
- Attachment chipA file on its way into a prompt: uploading, being read, ready or failed.
- Voice inputDictate a prompt: a waveform from your real mic level, a timer, then transcribing.
- Voice noteA voice message you can scrub and read along with: the waveform fills, the time rolls, and the transcript highlights each word as it’s said.
- Thinking indicatorFour quiet loaders for the gap before the first token, with a label, a rolling timer and a finish that draws itself.
- Thinking traceAn expandable record of what an agent did: steps, reasoning, search or tool calls.
- Tool callOne tool invocation from arguments to result: preparing, running, done, failed or denied.
- Clarifying questionThe agent pauses to ask. Pick with a click or a number key, or type your own; it folds into a one-line receipt.
- Approval cardThe agent asks before it acts: what it wants to do, the details, Approve or Deny.
- PlanAn agent’s checklist that ticks itself off: pending, in progress, done, skipped or failed.
- Web researchWatch the agent search: the query types in, page icons stack up as it reads, then it folds into a trail of searches and the pages each one found.
- Command outputA command the agent runs: the log streams in, folds away on success, and stays open on failure.
- Task progressFor work that takes minutes: phases, a live timer, stats, cancel, and the result when it’s done.
- Streaming answerAn answer as it arrives, with inline citations, actions, sources and follow-ups.
- Response versionsStep between regenerated answers with "2 / 3", and regenerate without losing the old ones.
- Inline rewriteDrag a dial and the paragraph rewrites itself in place: shared words glide, the rest blur out and rise in.
- Diff reviewAccept or reject what the AI changed, word by word for prose or line by line for code.
- Action receiptsWhat the agent actually did, one quiet line each, with Undo while a ring drains. Several stack into one.
- Error and limit statesCalm, specific notices for failed answers, being offline, rate limits and chats that grow too long.
- Usage meterCredits, messages or context left: quiet when there’s plenty, clear before it runs out.
- Usage limitsWhat an agent has left: the context window split by what fills it, and each plan limit with its share and a live reset countdown.
- Edit and resendFix a sent message where it sits. The bubble grows into an editor, then folds back and branches the reply.
- Earnings chartA bar chart that changes instead of redrawing: bars glide between periods, the scale and the total roll, a readout follows the pointer.
- Steps chartA week against a daily goal: days that make it fill in, a wave runs the way you step through the weeks, the totals roll.
- Revenue chartThis year as an area, last year behind it; point at a month and the header becomes the readout, switch the measure and the lines reshape.
- Area chartSeveral series stacked, overlapping or as shares: every band morphs between layouts, and the tiles are the legend, the switches and the readout.
- Trend chartOne metric over time, the way an analytics screen needs it: the period before as a dashed line, an unfinished day drawn dashed, a readout that glides with the pointer, and drag to zoom.
- Combo chartEvery day as a bar and the trend as a line on one scale: point at a day and the header becomes its readout while the line’s dot pings where it lands.
- Stage barsA funnel you can read at a glance: every stage as a bar against the first, the drop-off between them, and widths that ease when the period changes.
- Activity ringsThree daily goals as concentric rings beside a tight legend, with the week underneath: pick a day and the rings sweep to it.
- Donut chartParts of a whole as a ring or a half-ring gauge: point at a slice and the centre rolls to it, hide one and the rest slide round.
- Activity heatmapEvery day as a square, weeks across: one readout glides to the day you point at, and new numbers ripple through week by week.
- Live line chartOne metric as it happens: each point slides in at an even pace, the scale eases, and a Live pill pauses the view.
- WalletA balance you can send from: the balance panel turns into the transfer, the button goes Sending → Sent, and the money visibly leaves.
- ConvertA two-sided exchange block joined by a live rate hairline that shortens from both ends as the quote ages, re-quotes in place with delta and snaps taut on lock.
- Pricing plansPlans that turn into their own checkout: pick one and its card becomes the order, seats and totals rolling, then Continue opens your checkout.
- BookingBook a call on one card: the time you pick prints onto the host’s ticket, then the times turn into your details and the confirmation.
- CartA cart whose receipt does the maths in front of you: codes are stamped on, a rail of light fills toward free shipping and every total rolls.
- ReferralA referral pass that fills as friends join: their faces fly up into its notches, and the last one turns the track into Claim.
- FeedbackA score that changes the question: pick 0–10 or stars, the score rolls into the panel, and the follow-up and its tags fit what you picked.
- Buy boxA product buy box whose swatches repaint the product: pick a colour and size, and Add to bag throws the product into the bag.
- CheckoutA one-page checkout whose steps stack into a receipt: contact, address, delivery and your payment element, then Place order turns into the order number.
- Order statusAn order’s route with a parcel riding it: stops light as it passes, the arrival day rolls, and the carrier’s scans slide in.
- SubscriptionA billing page in one card: the plan with a ring through its billing period, usage, card and invoices, and a cancel that offers a pause first.
- File shareDrop files, watch them upload, and they fold into one share link with an expiry and an optional password.
- PollA poll whose bars race to their share: vote, and every option fills with light while the percentages roll and live votes keep nudging them.
- Verify codeA one-time code step with a carrier pigeon: Coo naps through the resend wait with the seconds in a thought bubble, and flies every new code to your mailbox.
- WaitlistA waitlist that is an actual line: you step in at the end with your number over your head, and every friend who joins lets you hop past the person ahead.
- StorageA storage meter with a raccoon and his suitcase: near the limit the case bulges and Pack sits on it to shut it; clean up and he hops down, upgrade and a roomy trunk arrives.
- Seat mapPick seats while other people are picking too: yours rise with your initials, and a seat taken under you turns over with a ripple and points to the next best.
- LeaderboardWhere you stand and what it takes to move up: a line that fills as you close on the person above, and an overtake that swings out a lane to pass.
- Halftone heroA monumental 3D WebGL halftone-engraved hero framed by a dense 4-band hairline grid, optical clarity pointer lens, velocity-braking logo rail and interactive 3D capability switcher.
In a live metric
Give it a new value whenever yours changes; it works out which digits roll and which way.
Props
- value
- number
- The number to show; change it and the digits roll.
- format / locales
- Intl.NumberFormatOptions / string | string[]
- Currency, percent, decimals, compact ("9.4K") and grouping, as Intl.NumberFormat does them. Without locales it formats in the visitor’s locale; pass one (e.g. from the request) to use it on the server and in the browser alike.
- prefix / suffix
- string
- Text around the number, e.g. "+" or " users".
- from
- number
- Start here and roll to value once painted.
- duration= 900
- number
- Roll time in ms.
- direction
- "up" | "down"
- Always roll this way. Use "down" for a countdown’s seconds, so 00 → 59 rolls back like a clock instead of spinning forward.
Accessibility and motion
- The full number is real text for screen readers, search and copy and paste; the rolling columns are hidden from assistive tech.
- Digits use tabular figures, so nothing shifts sideways while it rolls.
- No animation library: each column is a CSS transform, re-centred quietly after each roll.
- With reduced motion, digits change in place without rolling.
- Safe to server-render: without locales, the server and the hydrating render both format in en-US so the markup matches (Node and a browser can disagree, e.g. "$29" against "US$29"), then the visitor’s locale takes over in place, without a roll. Rendered only in the browser, it uses the visitor’s locale from the first paint. Pass locales to skip the switch.
Requirements
React 19, Tailwind CSS v4 and shadcn/ui theme variables (any style, light and dark). Icons from lucide-react.
Source
Registry item: /r/number-roll.json


