Skip to Content
šŸŽ‰Introducing Pumki UI
ComponentsTextSliding Number

Sliding Number Animation

A component that animates the transition between numbers.

Also used as Counter
Pumki UIPumki UI
.

Installation

Usage


1import { SlidingNumber } from '@/components/pumki-ui/text/sliding-number';

1<SlidingNumber number={55555} />

Example

Date and year

Using SlidingNumber component to display the current year with a sliding animation.

Pumki UIPumki UI

Props

PropTypeDefaultDescription
transition?SpringOptions{ stiffness: 200, damping: 20, mass: 0.4 }Animation config
decimalPlaces?number0Number of decimal places
decimalSeparator?string.Decimal separator character
padStart?booleanfalsePad with leading zeros
inViewOnce?booleantrueAnimate only once in view
inViewMargin?string0pxMargin for viewport detection
inView?booleanfalseEnable viewport-based animation
numbernumber | string-Value to animate
className?string-Class for root element
Last updated on