CountUp

A number that counts up to its value once it scrolls into view.

Import it from rei-kit/motion: import { CountUp } from 'rei-kit/motion'

Open CountUp in the live documentation, where every prop below is a control you can change, in four materials and ten palettes.

Usage

<script setup lang="ts">
import { CountUp } from 'rei-kit/motion'
</script>

<template>
  <CountUp :value="12480" />
</template>

Props

Props
PropTypeRequired or defaultWhat it is for
valuenumberyesThe number to count to. Change it and it counts on from where it is.
fromnumber0Where the first count starts.
durationnumber1600How long a count takes, in milliseconds.
formatIntl.NumberFormatOptionsundefinedPassed to `Intl.NumberFormat`. Set `maximumFractionDigits` to count in decimals.
localestringundefinedA BCP 47 tag. Unset, the kit's active formatting locale.

About rei-kit

rei-kit is an accessible Vue 3 and Tailwind CSS 4 component library: 106 components, themed by role rather than by colour on three independent axes — ten WCAG-checked palettes, four materials and light or dark, each switched with one attribute. Typed, tested, SSR-safe, no runtime dependencies, MIT.

pnpm add rei-kit · npm · GitHub