HeroStats Hero
Hero met inline statistieken rij eronder als horizontale band. Ankert de hero visueel.
src/components/hero/HeroStats.astro
---
/**
* HeroStats
* Hero met inline statistieken rij eronder. Gradient accent background.
* Stats als horizontale band die de hero verankert.
*/
interface Props {
eyebrow?: string;
headline: string;
sub?: string;
ctaPrimary?: { label: string; href: string };
ctaSecondary?: { label: string; href: string };
stats: { value: string; label: string; prefix?: string; suffix?: string }[];
bg?: 'white' | 'light' | 'dark';
}
const { eyebrow, headline, sub, ctaPrimary, ctaSecondary, stats, bg = 'light' } = Astro.props;
---
<section class={`hst hst--${bg}`}>
<div class="hst-hero">
{eyebrow && <p class="hst-eyebrow">{eyebrow}</p>}
<h1 class="hst-headline">{headline}</h1>
{sub && <p class="hst-sub">{sub}</p>}
{(ctaPrimary || ctaSecondary) && (
<div class="hst-actions">
{ctaPrimary && <a href={ctaPrimary.href} class="hst-btn hst-btn--primary">{ctaPrimary.label}</a>}
{ctaSecondary && <a href={ctaSecondary.href} class="hst-btn hst-btn--ghost">{ctaSecondary.label}</a>}
</div>
)}
</div>
<div class="hst-stats-bar">
{stats.map(s => (
<div class="hst-stat">
<span class="hst-stat-value">{s.prefix}{s.value}{s.suffix}</span>
<span class="hst-stat-label">{s.label}</span>
</div>
))}
</div>
</section>
<style>
.hst { background: #fff; }
.hst--light { background: #f8fafc; }
.hst--dark { background: #0f172a; color: #fff; }
.hst-hero { padding: 6rem 2rem 4rem; text-align: center; max-width: 760px; margin: 0 auto; }
.hst-eyebrow { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--color-accent,#6366f1); margin-bottom: 1rem; }
.hst-headline { font-size: clamp(2.5rem, 5vw, 4.5rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; margin: 0 0 1.25rem; }
.hst--dark .hst-headline { color: #fff; }
.hst-sub { font-size: 1.125rem; color: #64748b; line-height: 1.65; max-width: 560px; margin: 0 auto 2.5rem; }
.hst--dark .hst-sub { color: rgba(255,255,255,0.55); }
.hst-actions { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }
.hst-btn { display: inline-flex; align-items: center; padding: 0.8125rem 2rem; border-radius: 0.5rem; font-size: 0.9375rem; font-weight: 600; text-decoration: none; transition: all 0.2s; }
.hst-btn--primary { background: var(--color-accent,#6366f1); color: #fff; }
.hst-btn--primary:hover { opacity: 0.9; }
.hst-btn--ghost { border: 1.5px solid currentColor; color: inherit; opacity: 0.7; }
.hst-btn--ghost:hover { opacity: 1; }
.hst-stats-bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); border-top: 1px solid rgba(0,0,0,0.06); }
.hst--dark .hst-stats-bar { border-color: rgba(255,255,255,0.08); }
.hst-stat { padding: 2rem; text-align: center; border-right: 1px solid rgba(0,0,0,0.06); }
.hst--dark .hst-stat { border-color: rgba(255,255,255,0.08); }
.hst-stat:last-child { border-right: none; }
.hst-stat-value { display: block; font-size: clamp(1.75rem, 3vw, 2.5rem); font-weight: 800; color: var(--color-accent,#6366f1); letter-spacing: -0.02em; }
.hst-stat-label { display: block; font-size: 0.8125rem; color: #64748b; margin-top: 0.25rem; }
.hst--dark .hst-stat-label { color: rgba(255,255,255,0.4); }
</style>
Props
| Prop | Type | Default | Beschrijving |
|---|---|---|---|
headline * | string | — | H1 tekst |
stats * | { value: string; label: string; prefix?: string; suffix?: string }[] | — | Statistieken rij |
eyebrow | string | — | Eyebrow label |
sub | string | — | Ondertitel |
ctaPrimary | { label: string; href: string } | — | Primaire CTA |
ctaSecondary | { label: string; href: string } | — | Secundaire CTA |
bg | 'white' | 'light' | 'dark' | 'light' | Achtergrond variant |
* = verplicht