Stat Card with Trend Arrow
A copy-paste kpi & dashboard widgets component in pure HTML & CSS. Zero dependencies, framework-agnostic, MIT-licensed.
KPI & Dashboard WidgetsHTMLCSSany framework
Monthly Revenue▲ 12.4%
$48,210
vs $42,890 last month
Copy into your project
HTML
<div class="nuda-kpi-stat-card">
<div class="nuda-kpi-stat-card__header">
<span class="nuda-kpi-stat-card__label">Monthly Revenue</span>
<span class="nuda-kpi-stat-card__badge nuda-kpi-stat-card__badge--up">▲ 12.4%</span>
</div>
<div class="nuda-kpi-stat-card__value">$48,210</div>
<div class="nuda-kpi-stat-card__sub">vs $42,890 last month</div>
</div>CSS
.nuda-kpi-stat-card {
background: #1a1a1a;
border: 1px solid rgba(255,255,255,.1);
border-radius: 14px;
padding: 1.2rem 1.4rem;
display: flex;
flex-direction: column;
gap: .5rem;
min-width: 220px;
animation: _nuda-kpiFadeUp .35s ease-out;
}
.nuda-kpi-stat-card__header {
display: flex;
align-items: center;
justify-content: space-between;
}
.nuda-kpi-stat-card__label {
color: #777;
font-size: .75rem;
font-weight: 500;
text-transform: uppercase;
letter-spacing: .06em;
}
.nuda-kpi-stat-card__badge {
font-size: .72rem;
font-weight: 700;
padding: .2rem .5rem;
border-radius: 6px;
}
.nuda-kpi-stat-card__badge--up {
background: rgba(228,255,84,.12);
color: #e4ff54;
}
.nuda-kpi-stat-card__badge--down {
background: rgba(255,107,107,.12);
color: #ff6b6b;
}
.nuda-kpi-stat-card__value {
color: #fafafa;
font-size: 2rem;
font-weight: 700;
letter-spacing: -.03em;
line-height: 1;
}
.nuda-kpi-stat-card__sub {
color: #555;
font-size: .72rem;
}
@keyframes _nuda-kpiFadeUp {
from {
opacity: 0;
transform: translateY(8px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
@media (prefers-reduced-motion:reduce) {
.nuda-kpi-stat-card {
animation: none;
}
}
How to use Stat Card with Trend Arrow
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.