Zoeken...  ⌘K GitHub

HeadingCategory heading

Koptitel voorafgegaan door een categorie-label.

/heading-category
src/components/heading/HeadingCategory.astro
---
interface Props {
  category: string;
  title: string;
  sub?: string;
}
const { category = "Google Ads", title = "Maximale zichtbaarheid op het juiste moment", sub = "Bereik mensen die actief zoeken naar jouw product of dienst." } = Astro.props;
---

<div class="hd-cat">
  <span class="hd-cat__category">{category}</span>
  <h2 class="hd-cat__title">{title}</h2>
  {sub && <p class="hd-cat__sub">{sub}</p>}
</div>

<style>
  :root {
    --color-accent: #6366f1;
    --color-primary: #0a0a0a;
  }
  .hd-cat {
    padding: 2.5rem 0;
  }
  .hd-cat__category {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #fff;
    background: var(--color-primary);
    padding: 0.3rem 0.7rem;
    border-radius: 4px;
    margin-bottom: 1rem;
  }
  .hd-cat__title {
    margin: 0 0 0.75rem;
    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: 640px;
  }
  .hd-cat__sub {
    margin: 0;
    font-size: 1.05rem;
    color: #555;
    line-height: 1.65;
    max-width: 520px;
  }
</style>

Props

Prop Type Default Beschrijving
category * string Categorie-label
title * string Hoofdtitel
sub string Subtekst

* = verplicht