Count Up

0+

About this component

Count Up

A figure that counts up from zero to its value the first time it scrolls into view, with a prefix, a suffix, decimals and thousands grouping, in tabular numerals so nothing shifts.

Usage

The import and the props worth knowing about, in one place.

import { Text7 } from "@/components/beste/component/text7";

<Text7 value={2400} suffix="+" as="p" className="font-serif text-6xl" />

<Text7
  value={4.9}
  decimals={1}
  prefix=""
  duration={2}         // seconds
  grouping={false}     // no thousands separators (years, codes)
/>

Props

Read from the component's own type, so this cannot drift from what it accepts.

PropTypeDefaultDescription
value*number—The number to count up to
prefixstring—Printed before the number, e.g. "$"
suffixstring—Printed after the number, e.g. "%" or "+"
decimalsnumber—Decimal places to show
durationnumber—Seconds the count takes
delaynumber—Seconds before the count starts
groupingboolean—Group thousands with separators
as"p" | "span" | "dd" | "strong"—
classNamestring—

More Text components

View all Text
+

Roomtobreathe.

Progressrarelyfeelslikeprogresswhileitishappening.Sometimesitisshowingup.