@baneung-pack

CountUp

숫자가 부드럽게 증가/감소하는 카운터. 통계 섹션·KPI·achievement 카드에 사용. 마운트 또는 스크롤 진입 시 발사.

라이브 미리보기

0

inView 트리거 — KPI 섹션

스크롤해서 화면 안에 들어올 때 한 번만 발사됩니다.

0+다운로드
0K활성 사용자
0.0%만족도
0.00s평균 응답
0매출
0고객사
0.00%가동률
0ms응답 시간

기본 정수 + 콤마

0

소수점 + 퍼센트

0.0%

화폐 prefix

0

감소 카운터 (60 → 0)

60s

사용

import { CountUp } from '@baneung-pack/effect';

// 기본 — 천 단위 콤마 자동
<CountUp to={1234567} fontSize={48} fontWeight={800} />

// 소수점 + 퍼센트
<CountUp to={99.9} decimals={1} suffix="%" />

// 화폐 + 스크롤 트리거
<CountUp to={89000000} prefix="₩" trigger="inView" />

// 감소 카운트 (60 → 0)
<CountUp from={60} to={0} suffix="s" duration={2000} />

API

CountUpProps

PropertyType기본값설명
fromnumber0시작 숫자.
tonumber목표 숫자 (필수). from보다 작으면 감소.
durationnumber1500애니메이션 전체 시간 (ms).
separatorstring','천 단위 구분자. 빈 문자열이면 미적용.
decimalsnumber0소수점 자리수.
decimalSeparatorstring'.'소수점 구분자.
prefixstring''숫자 앞 문자열 (예: $, ₩).
suffixstring''숫자 뒤 문자열 (예: %, +, 명).
trigger'mount' | 'inView''mount'발사 시점.
thresholdnumber0.3inView 임계값 (0~1).
fontSizestring | number폰트 크기.
fontWeightCSSProperties['fontWeight']폰트 굵기.
colorstring텍스트 색.
classNamestring추가 클래스.
styleCSSProperties인라인 style.