For the complete documentation index, see llms.txt. Markdown variants are available by appending .md to any URL or sending an Accept: text/markdown header. An agent skill is available at /.well-known/agent-skills/site-skill.md.
Shadcn Labs/

Number Flip

Changed digits roll up when the number grows and down when it shrinks. Separators and unchanged digits stay put. A React component built on View Transitions, installed with the shadcn CLI.

Monthly revenue

$48,219.50

1,287 paying customers

Installation

$ pnpm dlx shadcn@latest add @transition-kit/number-flip

Usage

import { NumberFlip } from "@/components/transitions/number-flip";
const [price, setPrice] = useState(1299);
 
<NumberFlip value={price} format={{ style: "currency", currency: "EUR" }} />
<button type="button" onClick={() => setPrice((p) => p + 100)}>
  Add seat
</button>
<NumberFlip
  value={2_480_000}
  format={{ notation: "compact", maximumFractionDigits: 1 }}
  stagger
/>

API Reference

NumberFlip

PropTypeDefaultDescription
valuenumber-Number to display.
formatIntl.NumberFormatOptions-Intl.NumberFormat options used to format the number.
localesIntl.LocalesArgument"en-US"Locale used for formatting. Fixed by default so server and client render the same string; pass the user's locale to change it.
staggerbooleanfalseStaggers the rolls of changed digits.
classNamestring-Applied to the root <span>. Other props are spread onto it.