Number Ticker
A number that counts up with an ease-out curve when scrolled into view.
motionutils@soultel/use-reduced-motion-safe
0
Installation
$ pnpm dlx shadcn@latest add @soultel/number-tickerNo namespace set up? npx shadcn@latest add https://asafefe.dev/r/number-ticker.json works too.
Manual installation
- 1. Install the dependencies.
terminal1 lines npm install motion - 2. Copy the source from the Code tab into components/number-ticker.tsx.
Usage
import { NumberTicker } from "@/components/number-ticker"
export function Example() {
return <NumberTicker value={2847} />
}Props
| Prop | Type | Default | Description |
|---|---|---|---|
| value | number | - | Target value. |
| from | number | 0 | Starting value. |
| duration | number | 1400 | Count duration in ms. |
| format | "locale" | "plain" | "locale" | Thousands separators or raw digits. |
