Zoeken...  ⌘K GitHub

HeadingCenter heading

Volledig gecentreerde heading met decoratieve stippen.

/heading-center
src/components/heading/HeadingCenter.astro
---
/**
 * HeadingCenter
 * Volledig gecentreerde koptekst met subtitel en decoratieve stippen
 */
interface Props {
  label?: string;
  headline?: string;
  sub?: string;
}
const {
  label = 'Onze diensten',
  headline = 'Alles wat jouw merk nodig heeft om online te groeien',
  sub = 'Van strategie tot executie — we bieden een volledig pakket aan digitale marketingdiensten afgestemd op jouw doelen.',
} = Astro.props;
---

<div class="hcen">
  {label && (
    <div class="hcen__dots" aria-hidden="true">
      <span class="hcen__dot"></span>
      <span class="hcen__dot hcen__dot--accent"></span>
      <span class="hcen__dot"></span>
    </div>
  )}
  {label && <p class="hcen__label">{label}</p>}
  <h2 class="hcen__headline">{headline}</h2>
  {sub && <p class="hcen__sub">{sub}</p>}
</div>

<style>
  .hcen {
    text-align: center;
    padding: 3rem 1.5rem 2rem;
    max-width: 680px;
    margin: 0 auto;
  }
  .hcen__dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-bottom: 0.75rem;
  }
  .hcen__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #d4d4d4;
  }
  .hcen__dot--accent {
    background: var(--color-accent, #6366f1);
    width: 8px;
    height: 8px;
  }
  .hcen__label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-accent, #6366f1);
    margin: 0 0 0.75rem;
  }
  .hcen__headline {
    font-size: clamp(1.5rem, 3.5vw, 2.5rem);
    font-weight: 800;
    color: var(--color-primary, #0a0a0a);
    margin: 0 0 0.85rem;
    line-height: 1.2;
    letter-spacing: -0.025em;
  }
  .hcen__sub {
    font-size: 1rem;
    color: #666;
    line-height: 1.7;
    margin: 0;
  }
</style>

Props

Prop Type Default Beschrijving
headline string Headline
label string Label
sub string Subtitel

* = verplicht