Counter

Counts up on an overdamped spring: fast start, soft landing. Text.

Open playground
0

About

Counter is a React component in the Text category of smoui. It is typed, ships no stylesheet, follows your theme through CSS variables, and honors prefers-reduced-motion. Import it with import { Counter } from "@ashutoshswamy/smoui" and set to, duration, className.

Install

Terminal
npm i @ashutoshswamy/smoui

Usage

TSX
import { Counter } from "@ashutoshswamy/smoui";

<Counter to={12480} className="text-5xl font-semibold" />

Props 3

to

Target value.

number
duration

Rough seconds to settle.

numberdefault 1.5
className

Class on the <span>.

string