Zoeken...  ⌘K GitHub

CTAAccent CTA

CTA met accent achtergrondkleur en centered layout.

/cta-accent
src/components/cta/CTAAccent.astro
---
/**
 * CTAAccent
 * CTA sectie in accentkleur als achtergrond. Hoog contrast, veel aandacht.
 */
interface Props {
  headline: string;
  sub?: string;
  primary: { label: string; href: string };
  secondary?: { label: string; href: string };
  accentColor?: string;
}
const { headline, sub, primary, secondary, accentColor = '#6366f1' } = Astro.props;
---
<section class="ctaa" style={`background:${accentColor}`}>
  <div class="ctaa-inner">
    <h2 class="ctaa-headline">{headline}</h2>
    {sub && <p class="ctaa-sub">{sub}</p>}
    <div class="ctaa-btns">
      <a href={primary.href} class="ctaa-btn-primary">{primary.label}</a>
      {secondary && <a href={secondary.href} class="ctaa-btn-secondary">{secondary.label}</a>}
    </div>
  </div>
</section>
<style>
  .ctaa { padding: 5rem 2rem; }
  .ctaa-inner { max-width: 700px; margin: 0 auto; text-align: center; }
  .ctaa-headline { font-size: clamp(1.75rem, 4vw, 3rem); font-weight: 900; color: #fff; letter-spacing: -0.04em; line-height: 1.15; margin: 0 0 1rem; }
  .ctaa-sub { font-size: 1.0625rem; color: rgba(255,255,255,0.75); line-height: 1.65; margin: 0 0 2.5rem; }
  .ctaa-btns { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
  .ctaa-btn-primary { padding: 0.875rem 2.25rem; background: #fff; color: #0a0a0a; font-weight: 700; font-size: 0.9375rem; border-radius: 0.5rem; text-decoration: none; transition: opacity 0.2s; }
  .ctaa-btn-primary:hover { opacity: 0.9; }
  .ctaa-btn-secondary { padding: 0.875rem 2.25rem; border: 2px solid rgba(255,255,255,0.4); color: #fff; font-weight: 600; font-size: 0.9375rem; border-radius: 0.5rem; text-decoration: none; transition: all 0.2s; }
  .ctaa-btn-secondary:hover { background: rgba(255,255,255,0.1); }
</style>

Props

Prop Type Default Beschrijving
headline * string Hoofd CTA tekst
sub string Ondertitel
primary * { label: string; href: string } Primaire knop
secondary { label: string; href: string } Secundaire knop
eyebrow string Eyebrow label boven headline
accent string Achtergrondkleur (CSS kleurwaarde)

* = verplicht