Composite

Testimonials

Customer quotes with author, optional star rating and source, in a grid or a carousel.

Grid

The default layout="grid" places cards in up to columns columns, stepping down as the container narrows. Blank lines in quote start new paragraphs.

What our customers say

Real words from real teams.

Setup took ten minutes. We shipped our new landing page the same afternoon.

Ana RuizMarketing lead, Northwind

The blocks fit our design system without fighting it.

Our designers stopped filing tickets about spacing.

Sam OkaforFront-end engineer

Docs are clear, and every example is live. That alone saved us days.

Lee Chen
grid
---
import Testimonials from '@alfadormx/blocks/composite/Testimonials.astro';
import type { Testimonial } from '@alfadormx/blocks/types/testimonials';

const headline = { title: 'What our customers say', subtitle: 'Real words from real teams.' };

const testimonials: Testimonial[] = [
  {
    quote: 'Setup took ten minutes. We shipped our new landing page the same afternoon.',
    author: { name: 'Ana Ruiz', role: 'Marketing lead, Northwind' },
  },
  {
    quote:
      'The blocks fit our design system without fighting it.\n\nOur designers stopped filing tickets about spacing.',
    author: { name: 'Sam Okafor', role: 'Front-end engineer' },
  },
  {
    quote: 'Docs are clear, and every example is live. That alone saved us days.',
    author: { name: 'Lee Chen' },
  },
];
---

<Testimonials headline={headline} testimonials={testimonials} />

Rating

rating draws one to five stars. The stars are hidden from assistive tech; ratingLabel is read instead (default '{rating} out of 5').

5 out of 5

Setup took ten minutes. We shipped our new landing page the same afternoon.

Ana RuizMarketing lead, Northwind
4 out of 5

The blocks fit our design system without fighting it.

Our designers stopped filing tickets about spacing.

Sam OkaforFront-end engineer
3 out of 5

Docs are clear, and every example is live. That alone saved us days.

Lee Chen
rating
---
import Testimonials from '@alfadormx/blocks/composite/Testimonials.astro';
import type { Testimonial } from '@alfadormx/blocks/types/testimonials';

const testimonials: Testimonial[] = [
  {
    quote: 'Setup took ten minutes. We shipped our new landing page the same afternoon.',
    author: { name: 'Ana Ruiz', role: 'Marketing lead, Northwind' },
    rating: 5,
  },
  {
    quote:
      'The blocks fit our design system without fighting it.\n\nOur designers stopped filing tickets about spacing.',
    author: { name: 'Sam Okafor', role: 'Front-end engineer' },
    rating: 4,
  },
  {
    quote: 'Docs are clear, and every example is live. That alone saved us days.',
    author: { name: 'Lee Chen' },
    rating: 3,
  },
];
---

<Testimonials testimonials={testimonials} />

Avatar and source

author.avatar takes Image props and renders a small round photo. source adds a cited link to the original review.

5 out of 5

Setup took ten minutes. We shipped our new landing page the same afternoon.

Ana RuizMarketing lead, NorthwindG2

The blocks fit our design system without fighting it.

Our designers stopped filing tickets about spacing.

Sam OkaforFront-end engineer

Docs are clear, and every example is live. That alone saved us days.

Lee ChenProduct Hunt
avatar-source
---
import Testimonials from '@alfadormx/blocks/composite/Testimonials.astro';
import type { Testimonial } from '@alfadormx/blocks/types/testimonials';

const testimonials: Testimonial[] = [
  {
    quote: 'Setup took ten minutes. We shipped our new landing page the same afternoon.',
    rating: 5,
    author: {
      name: 'Ana Ruiz',
      role: 'Marketing lead, Northwind',
      avatar: {
        src: 'https://images.unsplash.com/photo-1494790108377-be9c29b29330?w=96&h=96&fit=crop&crop=faces',
        width: 48,
        height: 48,
      },
    },
    source: { label: 'G2', href: 'https://www.g2.com/' },
  },
  {
    quote:
      'The blocks fit our design system without fighting it.\n\nOur designers stopped filing tickets about spacing.',
    author: {
      name: 'Sam Okafor',
      role: 'Front-end engineer',
      avatar: {
        src: 'https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?w=96&h=96&fit=crop&crop=faces',
        width: 48,
        height: 48,
      },
    },
  },
  {
    quote: 'Docs are clear, and every example is live. That alone saved us days.',
    author: { name: 'Lee Chen' },
    source: { label: 'Product Hunt', href: 'https://www.producthunt.com/' },
  },
];
---

<Testimonials testimonials={testimonials} />

Shared config

defaultTestimonialConfig restyles or localizes every card, here a Spanish ratingLabel and the pull-quote font restored through quoteClass.

5 de 5 estrellas

Setup took ten minutes. We shipped our new landing page the same afternoon.

Ana RuizMarketing lead, Northwind
4 de 5 estrellas

The blocks fit our design system without fighting it.

Our designers stopped filing tickets about spacing.

Sam OkaforFront-end engineer
3 de 5 estrellas

Docs are clear, and every example is live. That alone saved us days.

Lee Chen
layer
---
import Testimonials from '@alfadormx/blocks/composite/Testimonials.astro';
import type { Testimonial } from '@alfadormx/blocks/types/testimonials';

const testimonials: Testimonial[] = [
  {
    quote: 'Setup took ten minutes. We shipped our new landing page the same afternoon.',
    author: { name: 'Ana Ruiz', role: 'Marketing lead, Northwind' },
    rating: 5,
  },
  {
    quote:
      'The blocks fit our design system without fighting it.\n\nOur designers stopped filing tickets about spacing.',
    author: { name: 'Sam Okafor', role: 'Front-end engineer' },
    rating: 4,
  },
  {
    quote: 'Docs are clear, and every example is live. That alone saved us days.',
    author: { name: 'Lee Chen' },
    rating: 3,
  },
];
---

<Testimonials
  testimonials={testimonials}
  columns={2}
  defaultTestimonialConfig={{
    ratingLabel: '{rating} de 5 estrellas',
    quoteClass: 'font-quote text-2xl',
  }}
/>

layout="carousel" puts one card per slide in a ContentCarousel, showing one, two or three at a time as the container widens (slideClass). Configure the carousel through contentCarousel. With more than one card per view, set loop: without it, the last positions leave empty space. Without JavaScript only the first cards show.

Loved by teams

carousel
---
import Testimonials from '@alfadormx/blocks/composite/Testimonials.astro';
import type { Testimonial } from '@alfadormx/blocks/types/testimonials';

const testimonials: Testimonial[] = [
  {
    quote: 'Setup took ten minutes. We shipped our new landing page the same afternoon.',
    author: { name: 'Ana Ruiz', role: 'Marketing lead, Northwind' },
    rating: 5,
  },
  {
    quote:
      'The blocks fit our design system without fighting it.\n\nOur designers stopped filing tickets about spacing.',
    author: { name: 'Sam Okafor', role: 'Front-end engineer' },
    rating: 4,
  },
  {
    quote: 'Docs are clear, and every example is live. That alone saved us days.',
    author: { name: 'Lee Chen' },
    rating: 3,
  },
  {
    quote: 'Swapping themes is one attribute. Our dark mode came for free.',
    author: { name: 'Priya Natarajan', role: 'Design lead, Fabrikam' },
    rating: 5,
  },
  {
    quote: 'We replaced three in-house carousels with one block and deleted a lot of code.',
    author: { name: 'Tomás Herrera', role: 'Staff engineer' },
    rating: 4,
  },
];
---

<Testimonials
  layout="carousel"
  headline={{ title: 'Loved by teams' }}
  testimonials={testimonials}
  contentCarousel={{ loop: true }}
/>

Single quote

One testimonial in one column, without role or rating.

One quote can carry a whole section when it is the right one.

Jordan Blake
single
---
import Testimonials from '@alfadormx/blocks/composite/Testimonials.astro';
import type { Testimonial } from '@alfadormx/blocks/types/testimonials';

const testimonials: Testimonial[] = [
  {
    quote: 'One quote can carry a whole section when it is the right one.',
    author: { name: 'Jordan Blake' },
  },
];
---

<Testimonials testimonials={testimonials} columns={1} />

API Reference

PropTypeDefaultDescription
containerContainerProps—Configuration for the outer Container
headlineHeadlineProps—Headline above the testimonials; not rendered when omitted (default: { htmlTag: 'h2', align: 'center' })
testimonialsTestimonial[]—The testimonials, at least one
layout'grid' | 'carousel''grid'Cards in a grid, or one card per slide in a ContentCarousel (default: 'grid')
columns1 | 2 | 3 | 43Grid columns at the widest size; steps down with the container width. Grid only (default: 3)
gap'none' | 'tight' | 'normal' | 'loose''normal'Space between cards. Grid only (default: 'normal')
testimonialsClassstring—Classes on the grid wrapper. Grid only
contentCarouselOmit<ContentCarouselProps, 'items'>—Configuration for the ContentCarousel. Carousel only (default: { ariaLabel: 'Testimonials', controlsPosition: 'outside' })
slideClassstring'basis-full @lg:basis-1/2 @3xl:basis-1/3'Basis classes on each slide, setting how many cards show at once. Carousel only (default: 'basis-full
defaultTestimonialConfigLayerConfig< Omit<Testimonial, 'quote' | 'author' | 'rating' | 'source'> >—Presentation merged under every testimonial, over the internal defaults