Skip to content

Goal Progress

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

Stats & CountersHTMLCSSany framework
Daily goal8.2k / 10k

Copy into your project

HTML
<!-- Goal Progress -->
<div class="nuda-goal">
  <div class="nuda-goal__head">
    <span class="nuda-goal__title">Daily goal</span>
    <span class="nuda-goal__amount">8.2k <i>/ 10k</i></span>
  </div>
  <div class="nuda-goal__track">
    <span class="nuda-goal__fill"></span>
    <span class="nuda-goal__shine"></span>
  </div>
  <div class="nuda-goal__steps">
    <span class="is-on"></span>
    <span class="is-on"></span>
    <span class="is-on"></span>
    <span class="is-on"></span>
    <span></span>
  </div>
</div>
CSS
/* Goal Progress
   Goal tracker: title + value, filling bar with shine, milestone segments.
   Customize: --goal-color, --goal-target. */

.nuda-goal {
  --goal-color: #e4ff54;
  --goal-target: 82%;
  width: 100%;
  max-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
}

.nuda-goal__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.nuda-goal__title {
  font: 600 0.625rem ui-sans-serif, system-ui, sans-serif;
  color: #a1a1aa;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.nuda-goal__amount {
  font: 700 0.875rem ui-sans-serif, system-ui, sans-serif;
  color: #fafafa;
  font-variant-numeric: tabular-nums;
}

.nuda-goal__amount i {
  font-size: 0.65rem;
  font-style: normal;
  color: #a1a1aa;
  font-weight: 500;
}

.nuda-goal__track {
  position: relative;
  height: 10px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 5px;
  overflow: hidden;
}

.nuda-goal__fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, rgba(228, 255, 84, 0.7), var(--goal-color));
  border-radius: 5px;
  animation: nuda-goal-fill 1.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.nuda-goal__shine {
  position: absolute;
  top: 0;
  left: -30%;
  width: 30%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: nuda-goal-shine 2.4s linear 1.6s infinite;
}

.nuda-goal__steps {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
}

.nuda-goal__steps span {
  height: 2px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 1px;
  transition: background 0.3s;
}

.nuda-goal__steps span.is-on {
  background: var(--goal-color);
  box-shadow: 0 0 4px rgba(228, 255, 84, 0.5);
}

@keyframes nuda-goal-fill { to { width: var(--goal-target); } }

@keyframes nuda-goal-shine {
  0%   { left: -30%; }
  100% { left: 130%; }
}

@media (prefers-reduced-motion: reduce) {
  .nuda-goal__fill  { width: var(--goal-target); animation: none; }
  .nuda-goal__shine { animation: none; opacity: 0; }
}

How to use Goal Progress

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