Zoeken...  ⌘K GitHub

TestimonialsWall Social Proof

Muur van korte klantcitaten in column-layout.

/testimonials-wall
src/components/social-proof/TestimonialsWall.astro
---
/**
 * TestimonialsWall
 * Muur van korte klantcitaten in Pinterest-stijl masonry layout.
 */
interface Props {
  eyebrow?: string;
  headline?: string;
  testimonials: { quote: string; name: string; role?: string; rating?: number }[];
  bg?: 'white' | 'light' | 'dark';
}
const { eyebrow, headline, testimonials, bg = 'light' } = Astro.props;
---
<section class={`tw tw--${bg}`}>
  <div class="tw-inner">
    {(eyebrow || headline) && (
      <div class="tw-header">
        {eyebrow && <span class="tw-eyebrow">{eyebrow}</span>}
        {headline && <h2 class="tw-headline">{headline}</h2>}
      </div>
    )}
    <div class="tw-wall">
      {testimonials.map(t => (
        <div class="tw-item">
          {t.rating && (
            <div class="tw-stars">
              {Array.from({length: t.rating}).map(() => <span class="tw-star">★</span>)}
            </div>
          )}
          <p class="tw-quote">"{t.quote}"</p>
          <div class="tw-meta">
            <span class="tw-name">{t.name}</span>
            {t.role && <span class="tw-role">{t.role}</span>}
          </div>
        </div>
      ))}
    </div>
  </div>
</section>
<style>
  .tw { padding: 5rem 2rem; }
  .tw--white { background: #fff; border-top: 1px solid #e5e7eb; }
  .tw--light { background: #f8fafc; border-top: 1px solid #e5e7eb; }
  .tw--dark { background: #0a0a0a; }
  .tw-inner { max-width: 1200px; margin: 0 auto; }
  .tw-header { text-align: center; margin-bottom: 3rem; }
  .tw-eyebrow { display: block; font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-accent,#6366f1); margin-bottom: 0.75rem; }
  .tw-headline { font-size: clamp(1.75rem, 3.5vw, 2.5rem); font-weight: 900; letter-spacing: -0.04em; line-height: 1.15; margin: 0; }
  .tw--white .tw-headline, .tw--light .tw-headline { color: #0a0a0a; }
  .tw--dark .tw-headline { color: #fff; }
  .tw-wall { columns: 3 300px; gap: 1.25rem; }
  .tw-item { break-inside: avoid; margin-bottom: 1.25rem; padding: 1.5rem; border-radius: 0.875rem; }
  .tw--white .tw-item { background: #f8fafc; border: 1px solid #e5e7eb; }
  .tw--light .tw-item { background: #fff; border: 1px solid #e5e7eb; }
  .tw--dark .tw-item { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.07); }
  .tw-stars { display: flex; gap: 0.2rem; margin-bottom: 0.625rem; }
  .tw-star { color: #f59e0b; font-size: 0.875rem; }
  .tw-quote { font-size: 0.9375rem; line-height: 1.65; margin: 0 0 0.875rem; font-style: italic; }
  .tw--white .tw-quote, .tw--light .tw-quote { color: #374151; }
  .tw--dark .tw-quote { color: rgba(255,255,255,0.7); }
  .tw-meta { display: flex; flex-direction: column; gap: 0.125rem; }
  .tw-name { font-size: 0.875rem; font-weight: 700; }
  .tw--white .tw-name, .tw--light .tw-name { color: #0a0a0a; }
  .tw--dark .tw-name { color: #fff; }
  .tw-role { font-size: 0.8125rem; }
  .tw--white .tw-role, .tw--light .tw-role { color: #9ca3af; }
  .tw--dark .tw-role { color: rgba(255,255,255,0.3); }
</style>

Props

Prop Type Default Beschrijving
testimonials * { quote: string; name: string; role?: string; rating?: number }[] Testimonial items
eyebrow string Eyebrow
headline string Sectie headline
bg 'white' | 'light' | 'dark' Achtergrond variant

* = verplicht