Zoeken...  ⌘K GitHub

HeadingBadge heading

Koptitel met badge-label (bv. "Nieuw").

/heading-badge
src/components/heading/HeadingBadge.astro
---
interface Props {
  badge: string;
  title: string;
  sub?: string;
}
const { badge = "Nieuw", title = "Introductie BLURR AI-pakket", sub = "Slimmere advertenties, minder verspilling, meer rendement." } = Astro.props;
---

<div class="hd-badge">
  <span class="hd-badge__badge">{badge}</span>
  <h2 class="hd-badge__title">{title}</h2>
  {sub && <p class="hd-badge__sub">{sub}</p>}
</div>

<style>
  :root {
    --color-accent: #6366f1;
    --color-primary: #0a0a0a;
  }
  .hd-badge {
    padding: 2.5rem 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  .hd-badge__badge {
    display: inline-block;
    background: var(--color-accent);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
  }
  .hd-badge__title {
    margin: 0;
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: 800;
    line-height: 1.15;
    color: var(--color-primary);
    letter-spacing: -0.02em;
  }
  .hd-badge__sub {
    margin: 0;
    font-size: 1.05rem;
    color: #555;
    line-height: 1.6;
    max-width: 520px;
  }
</style>

Props

Prop Type Default Beschrijving
badge * string Badge-tekst (bv. Nieuw, Beta)
title * string Hoofdtitel
sub string Subtekst

* = verplicht