Number Ticker
Slot machine-style digit rolling with direction awareness. Each digit independently rolls up or down based on value changes. Spring physics create satisfying overshoot.
Data Display
,
Installation
Copy and paste
Copy the component source code and paste it into your project.
import { NumberTicker } from "driftkit";Props
| Name | Type | Required | Description |
|---|---|---|---|
value | number | Yes | Numeric value to display. Changes trigger rolling animation. |
prefix | string | No | Text before the number (e.g., '$'). |
suffix | string | No | Text after the number (e.g., '%'). |
decimals | number | No | Decimal places to show. |
commas | boolean | No | Add thousand separators. |
fontSize | string | No | Custom font size. |
🎮
Playground
Tune spring physics for this component
Live Preview
Number Ticker Component
Spring Physics
300
30
1
Generated Code
const springConfig = {
"type": "spring",
"stiffness": 300,
"damping": 30,
"mass": 1
};
// Basic hover animation
<motion.div
whileHover={{ scale: 1.05 }}
whileTap={{ scale: 0.95 }}
transition={springConfig}
>
<NumberTicker />
</motion.div>
// Advanced with custom animations
<motion.div
animate={{
scale: [1, 1.02, 1],
y: [0, -4, 0]
}}
transition={{
...springConfig,
repeat: Infinity,
repeatDelay: 2
}}
>
<NumberTicker />
</motion.div>Stiffness: Controls animation speed. Higher values create snappier animations.
Damping: Controls resistance to motion. Lower values create more bounce and overshoot.
Mass: Controls the perceived weight. Higher values make animations slower with more momentum.
Source Code
View the source code on GitHub to see the full implementation.
View on GitHub