Zoeken...  ⌘K GitHub

HeadingFloat heading

Koptitel met zwevendlabel links.

/heading-float
src/components/heading/HeadingFloat.astro
---
interface Props {
  floatLabel: string;
  title: string;
  sub?: string;
}
const { floatLabel = "Stap voor stap", title = "Jouw bedrijf naar de top", sub = "Wij begeleiden je van strategie tot executie." } = Astro.props;
---

<div class="hd-float">
  <span class="hd-float__label">{floatLabel}</span>
  <h2 class="hd-float__title">{title}</h2>
  {sub && <p class="hd-float__sub">{sub}</p>}
</div>

<style>
  :root {
    --color-accent: #6366f1;
    --color-primary: #0a0a0a;
  }
  .hd-float {
    padding: 2.5rem 0;
    position: relative;
  }
  .hd-float__label {
    position: absolute;
    top: 1.5rem;
    right: 0;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-accent);
    writing-mode: vertical-rl;
    text-orientation: mixed;
    opacity: 0.7;
  }
  .hd-float__title {
    margin: 0 0 0.75rem;
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    color: var(--color-primary);
    line-height: 1.1;
    letter-spacing: -0.025em;
    max-width: 640px;
  }
  .hd-float__sub {
    margin: 0;
    font-size: 1.05rem;
    color: #555;
    line-height: 1.65;
    max-width: 520px;
  }
</style>

Props

Prop Type Default Beschrijving
floatLabel * string Label dat zweeft naast de titel
title * string Hoofdtitel
sub string Subtekst

* = verplicht