프리뷰 또는 이전 버전의 문서를 보고 있습니다.seed-design.io 방문
우리는 왜 디자인 엔지니어를 찾게 됐을까
Skip to Content

Animate Number

숫자를 부드럽게 애니메이션하는 유틸리티 컴포넌트

1

Installation

Dependency:

npm install motion

Snippet:

npx @seed-design/cli@latest add breeze:animate-number

Configuration

animate-number 컴포넌트는 motion의 m. 컴포넌트를 사용합니다. lazy loading을 위해 프로젝트에 MotionProvider를 설정해야 합니다.

자세한 내용은 Motion Lazy Motion 문서를 참고하세요.

MotionProvider.tsx
"use client";

import { LazyMotion } from "motion/react";
import type { ReactNode } from "react";

const loadFeatures = () => import("motion/react").then((res) => res.domAnimation);

export function MotionProvider({ children }: { children: ReactNode }) {
  return <LazyMotion features={loadFeatures}>{children}</LazyMotion>;
}
index.tsx
import { createRoot } from 'react-dom/client'
import App from './App.tsx'
import { MotionProvider } from './MotionProvider.tsx'

createRoot(document.getElementById('root')!).render(
  <MotionProvider>
    <App />
  </MotionProvider>
)

Props

Prop

Type

valuenumber

표시할 숫자 값

fontSize?string | number | undefined

폰트 크기

Default

48

fontWeight?Property.FontWeight | undefined

폰트 굵기

Default

"bold"

color?string | undefined

텍스트 색상

Default

"currentColor"

showComma?boolean | undefined

천 단위 구분 쉼표 표시

Default

false

showGradient?boolean | undefined

위아래 그라디언트 마스크 표시

Default

false

gradientHeight?number | undefined

그라디언트 마스크 높이 (px)

Default

20

containerStyle?React.CSSProperties | undefined

컨테이너 스타일

className?string | undefined

추가 클래스명

Examples

Comma

1,234

Gradient

999

Custom Style

42

Last updated on 2026. 6. 4.