Counter

PreviousNext

Flexible animated counter supporting increments + easing.

Docs
react-bitscomponent

Preview

Loading preview…
Counter/Counter.css
.counter-container {
  position: relative;
  display: inline-block;
}

.counter-counter {
  display: flex;
  overflow: hidden;
  line-height: 1;
}

.counter-digit {
  position: relative;
  width: 1ch;
  font-variant-numeric: tabular-nums;
}

.counter-number {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gradient-container {
  pointer-events: none;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
}

.bottom-gradient {
  position: absolute;
  bottom: 0;
  width: 100%;
}

Installation

npx shadcn@latest add @react-bits/Counter-TS-CSS

Usage

import { CounterTSCSS } from "@/components/Counter-TS-CSS"
<CounterTSCSS />