500

Number Counter Component

An animated counter component that smoothly transitions between number values.

  • Smooth animation between value changes
  • Configurable duration and easing functions
  • Custom formatting options
  • Supports various numerical displays like currency and percentages

Installation

The Number Counter component is part of our UI library. You can import it directly from the components directory.


Usage

Here is how to use the Number Counter component in your project.

React TSX
1import { NumberCounter } from "@/components/modern-ui/number-counter"

React TSX
1<NumberCounter value={200} startValue={100} />

Examples

Default Number Counter

0

Custom Formatted Counter

Revenue

0

Animated Number Counter Group

Users

0+

Revenue

$0

Conversion

0%

API Reference

Properties

PropertyTypeDefaultDescription
valuenumberRequiredThe target value to count to
startValuenumber0The initial value to start counting from
direction"up" | "down""up"The direction of the animation
delaynumber0Delay before starting the animation in seconds
decimalPlacesnumber0Number of decimal places to show
classNamestring-Additional CSS classes for the component