Zoeken...  ⌘K GitHub

HeadingWithStats heading

Koptitel gecombineerd met een rij statistieken.

/heading-with-stats
src/components/heading/HeadingWithStats.astro
---
interface Props {
  eyebrow?: string;
  title: string;
  stats?: Array<{ value: string; label: string }>;
}
const {
  eyebrow = "Resultaten",
  title = "Cijfers die bewijzen dat het werkt",
  stats = [
    { value: "3.8×", label: "Gemiddeld ROAS" },
    { value: "80+", label: "Tevreden klanten" },
    { value: "€12M+", label: "Omzet gegenereerd" },
  ]
} = Astro.props;
---

<div class="hd-stats">
  <div class="hd-stats__header">
    {eyebrow && <span class="hd-stats__eyebrow">{eyebrow}</span>}
    <h2 class="hd-stats__title">{title}</h2>
  </div>
  {stats && stats.length > 0 && (
    <div class="hd-stats__row">
      {stats.map(s => (
        <div class="hd-stats__item">
          <span class="hd-stats__value">{s.value}</span>
          <span class="hd-stats__label">{s.label}</span>
        </div>
      ))}
    </div>
  )}
</div>

<style>
  :root {
    --color-accent: #6366f1;
    --color-primary: #0a0a0a;
  }
  .hd-stats {
    padding: 2.5rem 0;
  }
  .hd-stats__header {
    margin-bottom: 2rem;
  }
  .hd-stats__eyebrow {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: 0.5rem;
  }
  .hd-stats__title {
    margin: 0;
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: 800;
    color: var(--color-primary);
    line-height: 1.15;
    letter-spacing: -0.02em;
    max-width: 600px;
  }
  .hd-stats__row {
    display: flex;
    gap: 2.5rem;
    flex-wrap: wrap;
    padding-top: 2rem;
    border-top: 1px solid #e5e5e5;
  }
  .hd-stats__item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
  }
  .hd-stats__value {
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 900;
    color: var(--color-accent);
    line-height: 1;
    letter-spacing: -0.03em;
  }
  .hd-stats__label {
    font-size: 0.85rem;
    color: #666;
    font-weight: 500;
  }
</style>

Props

Prop Type Default Beschrijving
eyebrow string Klein label boven de titel
title * string Hoofdtitel
stats { value: string; label: string }[] Statistieken onder de koptitel

* = verplicht