Number Ticker
Animate numbers to count up or down to a target number.
0
import { NumberTicker } from '@/registry/magicui/number-ticker'
export function NumberTickerDemo() { return ( <NumberTicker value={100} class=" text-8xl font-medium tracking-tighter whitespace-pre-wrap text-black dark:text-white " /> )}Installation
Section titled “Installation”pnpm dlx shadcn@latest add @magicui-solid/number-tickerbunx shadcn@latest add @magicui-solid/number-tickeryarn dlx shadcn@latest add @magicui-solid/number-tickernpx shadcn@latest add @magicui-solid/number-tickerExample
Section titled “Example”Decimal
Section titled “Decimal”0
import { NumberTicker } from '@/registry/magicui/number-ticker'
export function NumberTickerDecimalDemo() { return ( <NumberTicker value={5.67} decimalPlaces={2} class=" text-8xl font-medium tracking-tighter whitespace-pre-wrap text-black dark:text-white " /> )}Start Value
Section titled “Start Value”80
import { NumberTicker } from '@/registry/magicui/number-ticker'
export function NumberTickerDemo2() { return ( <NumberTicker value={100} startValue={80} class=" text-8xl font-medium tracking-tighter whitespace-pre-wrap text-black dark:text-white " /> )}import { NumberTicker } from '@/components/magicui/number-ticker'<NumberTicker value={100} />| Prop | Type | Default | Description |
|---|---|---|---|
value |
int |
0 |
The value to count to |
direction |
"up" "down" |
"up" |
The direction to count in |
delay |
number |
0 |
The delay before counting |
decimalPlaces |
number |
0 |
The number of decimal places to show |
startValue |
number |
0 |
The value to start counting from |
Original:
magicui.design/docs/components/number-ticker