Data & Status

Animated Number

목표 숫자까지 자연스럽게 증가하거나 감소하는 숫자 애니메이션입니다.

Preview

text motion

0

count up to the latest value

Installation

bash
Copied
1pnpm dlx shadcn@latest add https://ryong-blog.vercel.app/r/number-ticker.json

Code

typescript
Copied
1import { NumberTicker } from "@/components/number-ticker"23export default function Example() {4  return <NumberTicker value={1200} />5}

Props

value

Type
number
Default
-
Description
Target number.

startValue

Type
number
Default
0
Description
Initial number.

direction

Type
"up" | "down"
Default
"up"
Description
Count direction.

delay

Type
number
Default
0
Description
Start delay.

decimalPlaces

Type
number
Default
0
Description
Decimal precision.

Reference

Reference Animated Number