HeroCenteredMinimal Hero
Puur typografische centered hero. Geen afbeelding. 4 achtergrondvarianten. Ideaal voor SaaS.
src/components/hero/HeroCenteredMinimal.astro
---
/**
* HeroCenteredMinimal
* Gecentreerde typografische hero — geen afbeelding, pure typografie + 1 grote CTA.
* Ideaal voor SaaS / bureau / brand storytelling.
*/
interface Props {
label?: string;
headline: string;
sub: string;
ctaLabel?: string;
ctaHref?: string;
ctaSecondary?: string;
ctaSecondaryHref?: string;
trustLine?: string;
bg?: 'white' | 'light' | 'dark' | 'accent';
}
const {
label,
headline,
sub,
ctaLabel = 'Begin vandaag',
ctaHref = '#',
ctaSecondary,
ctaSecondaryHref = '#',
trustLine,
bg = 'white',
} = Astro.props;
---
<section class:list={['hcm', `hcm--bg-${bg}`]} data-component="hero-centered-minimal">
<div class="hcm__inner">
{label && (
<div class="hcm__label">
<span class="hcm__label-dot"></span>
{label}
</div>
)}
<h1 class="hcm__headline" set:html={headline} />
<p class="hcm__sub">{sub}</p>
<div class="hcm__ctas">
<a href={ctaHref} class="hcm__cta hcm__cta--primary">{ctaLabel}</a>
{ctaSecondary && (
<a href={ctaSecondaryHref} class="hcm__cta hcm__cta--ghost">{ctaSecondary}</a>
)}
</div>
{trustLine && (
<p class="hcm__trust">{trustLine}</p>
)}
</div>
</section>
<style>
.hcm {
padding: 7rem 1.5rem 6rem;
text-align: center;
}
.hcm--bg-white { background: var(--color-bg, #fff); }
.hcm--bg-light { background: #f5f5f7; }
.hcm--bg-dark {
background: var(--color-primary, #0a0a0a);
color: #fff;
}
.hcm--bg-accent {
background: var(--color-accent, #6366f1);
color: #fff;
}
.hcm__inner {
max-width: 760px;
margin: 0 auto;
}
.hcm__label {
display: inline-flex;
align-items: center;
gap: 0.5rem;
font-size: 0.8125rem;
font-weight: 600;
letter-spacing: 0.04em;
margin-bottom: 1.5rem;
padding: 0.375rem 1rem;
border-radius: 100px;
border: 1px solid currentColor;
opacity: 0.5;
}
.hcm--bg-dark .hcm__label,
.hcm--bg-accent .hcm__label {
color: #fff;
border-color: rgba(255,255,255,0.3);
opacity: 0.8;
}
.hcm__label-dot {
width: 6px;
height: 6px;
border-radius: 50%;
background: var(--color-accent, #6366f1);
flex-shrink: 0;
}
.hcm--bg-accent .hcm__label-dot { background: #fff; }
.hcm__headline {
font-size: clamp(2.75rem, 6vw, 5rem);
font-weight: 800;
line-height: 1.05;
letter-spacing: -0.04em;
color: var(--color-primary, #0a0a0a);
margin-bottom: 1.5rem;
}
.hcm--bg-dark .hcm__headline,
.hcm--bg-accent .hcm__headline {
color: #fff;
}
.hcm__headline :global(em) {
font-style: normal;
color: var(--color-accent, #6366f1);
}
.hcm--bg-accent .hcm__headline :global(em) {
color: rgba(255,255,255,0.75);
}
.hcm__sub {
font-size: 1.1875rem;
line-height: 1.65;
color: var(--color-muted, #6b7280);
margin-bottom: 2.5rem;
max-width: 52ch;
margin-left: auto;
margin-right: auto;
}
.hcm--bg-dark .hcm__sub,
.hcm--bg-accent .hcm__sub {
color: rgba(255,255,255,0.65);
}
.hcm__ctas {
display: flex;
gap: 0.875rem;
justify-content: center;
flex-wrap: wrap;
margin-bottom: 1.5rem;
}
.hcm__cta {
display: inline-block;
padding: 0.9375rem 2rem;
border-radius: var(--radius, 0.5rem);
font-weight: 700;
font-size: 1rem;
text-decoration: none;
transition: all 0.2s;
}
.hcm__cta--primary {
background: var(--color-accent, #6366f1);
color: #fff;
}
.hcm--bg-accent .hcm__cta--primary {
background: #fff;
color: var(--color-accent, #6366f1);
}
.hcm__cta--primary:hover {
filter: brightness(1.1);
transform: translateY(-2px);
box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}
.hcm__cta--ghost {
border: 1.5px solid var(--color-primary, #0a0a0a);
color: var(--color-primary, #0a0a0a);
opacity: 0.7;
}
.hcm--bg-dark .hcm__cta--ghost,
.hcm--bg-accent .hcm__cta--ghost {
border-color: rgba(255,255,255,0.4);
color: #fff;
}
.hcm__cta--ghost:hover {
opacity: 1;
}
.hcm__trust {
font-size: 0.8125rem;
color: var(--color-muted, #6b7280);
}
.hcm--bg-dark .hcm__trust,
.hcm--bg-accent .hcm__trust {
color: rgba(255,255,255,0.45);
}
@media (max-width: 640px) {
.hcm { padding: 4rem 1.25rem; }
.hcm__cta { width: 100%; text-align: center; }
.hcm__ctas { flex-direction: column; align-items: center; }
}
</style>
Props
| Prop | Type | Default | Beschrijving |
|---|---|---|---|
headline * | string | — | Grote H1 — gebruik <em> voor accent |
sub * | string | — | Ondertitel |
bg | 'white' | 'light' | 'dark' | 'accent' | 'white' | Achtergrondvariant |
label | string | — | Klein pill-label boven headline |
trustLine | string | — | Vertrouwensregel onder CTA |
* = verplicht