2.0 alpha
These docs describe 2.0. Install it with @once-ui-system/core@alpha.
On 1.8.x? Read the 1.x docs
TrademarkTrademarkDocs
Ctrl k
Search docs...
Effects

CountFx

Updated: May 11, 2025
View on GitHub
CountFx is a wrapper for numbers with different animation effects. CountFx supports decimal values with the decimals prop. Use the useInViewport hook to trigger the count animation when the element enters the viewport. This example starts counting when the element reaches the center of the screen.
Prop
Type
Default
valuerequired
The number to count to. Change it and the count runs again — there is no trigger prop.
number
speed
How long the count takes, in milliseconds.
number1000
easing
How the count accelerates and settles.
linearease-outease-in-out
ease-out
format
Turn the number into the string shown, for a currency or a unit.
(value: number) => string
separator
Thousands separator.
string
decimals
Decimal places to hold.
number
effect
How the digits change: a plain count, a wheel, or a smooth blur.
simplewheelsmooth
simple
children
Rendered after the number.
React.ReactNode
…and every FlexProps propinherited
…and every TextProps propinherited
className
string
style
React.CSSProperties
Edit this page on GitHub
TrademarkTrademark
Built with curiosity by Lorant One and the Design Engineers Club