# Sparkline Stat Card

> A dark dashboard metric card with a big number, change badge and an inline SVG sparkline with area fill.

- Category: [CSS Cards](https://copy-css.com/category/cards)
- Tags: dashboard, kpi, sparkline, chart, svg, analytics, dark
- Live preview: https://copy-css.com/snippets/sparkline-stat-card
- License: Free for personal and commercial use. No signup, no attribution required.

## HTML

```html
<article class="spark-stat">
  <p>Revenue</p>
  <strong>$84.2k</strong>
  <span class="spark-stat-delta">+8.1%</span>
  <svg viewBox="0 0 120 40" preserveAspectRatio="none" aria-hidden="true">
    <path class="spark-stat-area" d="M0 34 15 28 30 30 45 20 60 24 75 14 90 16 105 8 120 10V40H0Z"/>
    <path class="spark-stat-line" d="M0 34 15 28 30 30 45 20 60 24 75 14 90 16 105 8 120 10"/>
  </svg>
</article>
```

## CSS

```css
.spark-stat {
  --spark: #34d399;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  width: 220px;
  padding: 16px 18px 0;
  overflow: hidden;
  border: 1px solid #1e293b;
  border-radius: 16px;
  background: #111827;
  color: #f8fafc;
  font-family: system-ui, sans-serif;
}

.spark-stat p {
  grid-column: 1 / -1;
  margin: 0;
  color: #94a3b8;
  font-size: 13px;
}

.spark-stat strong {
  font-size: 28px;
  letter-spacing: -0.02em;
}

.spark-stat-delta {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.15);
  color: var(--spark);
  font-size: 12px;
  font-weight: 700;
}

.spark-stat svg {
  grid-column: 1 / -1;
  width: calc(100% + 36px);
  height: 48px;
  margin: 8px -18px 0;
}

.spark-stat-area {
  fill: var(--spark);
  opacity: 0.15;
}

.spark-stat-line {
  fill: none;
  stroke: var(--spark);
  stroke-width: 2;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
```

## Notes

- This CSS Sparkline Stat Card is 55 lines of pure CSS (0.9 KB) with no JavaScript and no dependencies. It uses CSS Grid and custom properties.
- Customize with: `--spark`.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
