Skip to content

Split-Flap Counter

A copy-paste stats & counters component in pure HTML & CSS. Zero dependencies, framework-agnostic, MIT-licensed.

Stats & CountersHTMLCSSany framework

Copy into your project

HTML
<!-- Split-Flap Counter — each card flips its digit into place on a stagger -->
<div class="nuda-sc2-splitflap" role="img" aria-label="847 tickets sold">
  <div class="nuda-sc2-splitflap__card" style="--i:0"><span>8</span></div>
  <div class="nuda-sc2-splitflap__card" style="--i:1"><span>4</span></div>
  <div class="nuda-sc2-splitflap__card" style="--i:2"><span>7</span></div>
  <span class="nuda-sc2-splitflap__label">tickets sold</span>
</div>
CSS
.nuda-sc2-splitflap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
}

.nuda-sc2-splitflap__card {
  width: 24px;
  height: 32px;
  background: #161616;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  perspective: 120px;
}

.nuda-sc2-splitflap__card span {
  font: 700 16px ui-sans-serif,system-ui;
  color: #fafafa;
  font-variant-numeric: tabular-nums;
  display: inline-block;
  transform-origin: center;
  animation: _nuda-sc2splitflap-flip .5s cubic-bezier(.4,0,.2,1) backwards;
  animation-delay: calc(var(--i) * .14s);
}

.nuda-sc2-splitflap__card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: rgba(0,0,0,.5);
  pointer-events: none;
}

.nuda-sc2-splitflap__label {
  font: 500 9px ui-sans-serif,system-ui;
  color: #777;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-left: 2px;
}

@keyframes _nuda-sc2splitflap-flip {
  from {
    transform: rotateX(-90deg);
    opacity: 0;
  }
  to {
    transform: rotateX(0deg);
    opacity: 1;
  }
}

@media (prefers-reduced-motion:reduce) {
  .nuda-sc2-splitflap__card span {
    animation: none !important;
    transform: rotateX(0deg);
    opacity: 1;
  }
}

How to use Split-Flap Counter

Paste the HTML where you need it and the CSS into a global stylesheet (or a <style> tag). Every class is prefixed nuda- so it never collides with Tailwind or your own styles. Tweak the CSS custom properties to match your design system.

Works in React, Vue, Svelte, Astro, Next.js, Nuxt, Laravel Blade, Django, Rails — or a single .html file. No npm install, no build step.

More stats & counters components

← Browse all NudaUI components