Flap counter Pro
Get Pro at $9
One payment, every Pro piece. $10 tomorrow.
Install
npx shadcn@latest add @mu-pro/flap-counterPro. Installs with your licence key through the @mu-pro registry; the key comes with Pro. Lands in components/mu/flap-counter/ with the shared foundation.
Usage
import { FlapCounter } from "@/components/mu/flap-counter/FlapCounter";
<FlapCounter value={followers} milestone={1000} labels={{ title: "Followers" }} />Source
How it works
Building with an agent? Hand it a ready prompt for this piece.
Input and reduced motion
- Pointer / touch: nothing to press; it reads. The value is in the page as text (with
labels.title) for screen readers, and the line under the hero tiles is a polite live region. - Keyboard: no stops of its own.
- Reduced motion: every flap swaps with no fall and no riffle, a count lands in one change, and the band of light is not drawn. The tiles and words end exactly where full motion ends.
- Off screen: it waits until half of it is in view to riffle and count; scrolled away mid-count, every tile lands on its value at once and nothing runs.
Props
| Prop | Default | What it does |
|---|---|---|
value | — | a number, a word, or null | the count (right-aligned) or a word (centred, uppercased); null shows the loading state |
milestone | — | a number | the moment: when the count reaches it, one band of light crosses the tiles and the line says so |
onMilestone | — | (milestone) => void | fires once when a new value reaches the milestone; never on the first count after load |
riffle | ["HEY!"] (hero), [] (inline) | words | riffled in, one after another, before the first count |
digits | widest of value and milestone | 1–12 | how many number tiles |
size | "hero" | "hero", "inline" | hero: up to 72px tiles (or --flap-counter-max) that fit their container, a title and two lines; inline: 17 × 26 tiles for a dashboard cell |
icon | — | a node | drawn on a last, fixed tile (a person for followers) |
status | "ready" | "ready", "loading", "failed" | loading: blank tiles; failed: dashes and labels.failed |
labels | see below | strings | title, toGo ("{n} more to go"), reached ("{milestone} reached. Thank you."), note, reachedNote ("{next}" is ten times the milestone), loading, failed |
className | — | — | added to the root |
Sound
None. It loads in silence.
None. A counter changes because your data did, never because a person pressed it, and an item stays silent when a prop starts the work.
Licence
Included with Pro: use it in unlimited end products for you and your clients; no reselling as a kit. See the licence.
A split-flap counter for a milestone: it riffles words, then counts up, and the carry flips right to left.
For milestones, launches and big numbersMore in Data & live