Skip to content
Organisms

Testimonials

Customer quotes as a marquee or a grid.

Primitive

Installation

Primitive
  1. Run the CLI

    Run pnpm dlx asta-ui@latest init once, then this. The file lands in components/astabyte/, installs radix-ui@base-ui/react and the colour tokens go into your CSS. This is the Radix build. Drop --radix for Base UI.This is the Base UI build, the default. Want Radix? Add --radix.

    $ pnpm dlx asta-ui@latest add testimonials --radix

    Or with the shadcn CLI: pnpm dlx shadcn@latest add https://ui.astabyte.com/r/base/testimonials.json

  2. Or install the package

    Don’t want the file? Import from asta-uiasta-ui/base and update with pnpm update asta-ui. Add the stylesheet once. More.

    $ pnpm add asta-ui radix-ui @base-ui/react
    import { Testimonials } from "asta-ui";
    import { Testimonials } from "asta-ui/base";
  3. Or copy it by hand

    Install radix-ui@base-ui/react, then copy these files. Keep the paths, or fix the @/ imports. Then add the tokens from globals.css.

    "use client";
    
    import { useEffect, useRef, useState } from "react";
    import { Avatar } from "@/components/kit/avatar";
    
    const cx = (...c: (string | false | null | undefined)[]) => c.filter(Boolean).join(" ");
    
    const KEYFRAMES = `@keyframes asta-tm-left { to { transform: translateX(-50%) } }
    @keyframes asta-tm-right { from { transform: translateX(-50%) } to { transform: none } }
    .asta-tm-root[data-paused] .asta-tm-track, .asta-tm-row:hover .asta-tm-track, .asta-tm-row:focus-within .asta-tm-track { animation-play-state: paused }
    @media (prefers-reduced-motion: reduce) { .asta-tm-marquee { display: none !important } .asta-tm-still { display: grid !important } }`;
    
    export interface Testimonial {
      quote: string;
      name: string;
      /** Role and company, e.g. "Head of Product, Juniper Goods". */
      title?: string;
      avatar?: string;
      /** 1–5. Shows stars when set. */
      rating?: number;
    }
    
    export interface TestimonialsProps {
      items: Testimonial[];
      /** Two rows drifting in opposite directions, or a still grid. Reduced motion always gets the grid. */
      variant?: "marquee" | "grid";
      /** Seconds for one full loop of a row. */
      speed?: number;
      label?: string;
      className?: string;
    }
    
    function Card({ t, className }: { t: Testimonial; className?: string }) {
      return (
        <figure className={cx("flex flex-col justify-between gap-5 rounded-[12px] bg-paper-2 p-5", className)}>
          <div className="flex flex-col gap-3">
            {t.rating ? (
              <span className="flex gap-0.5 text-brand" role="img" aria-label={`${t.rating} out of 5`}>
                {Array.from({ length: 5 }, (_, i) => (
                  <svg key={i} viewBox="0 0 24 24" className={cx("h-3.5 w-3.5", i >= t.rating! && "opacity-25")} fill="currentColor" stroke="currentColor" strokeWidth="1.75" strokeLinejoin="round" aria-hidden>
                    <path d="m12 3.8 2.5 5.1 5.6.8-4 4 .9 5.6-5-2.7-5 2.7.9-5.6-4-4 5.6-.8Z" />
                  </svg>
                ))}
              </span>
            ) : null}
            <blockquote className="text-[14px] leading-relaxed text-ink">“{t.quote}”</blockquote>
          </div>
          <figcaption className="flex items-center gap-3">
            <Avatar name={t.name} src={t.avatar} size="sm" />
            <span className="min-w-0">
              <span className="block truncate text-[13px] font-medium">{t.name}</span>
              {t.title && <span className="block truncate text-[12px] text-mute">{t.title}</span>}
            </span>
          </figcaption>
        </figure>
      );
    }
    
    /**
     * Customer quotes. The marquee runs two rows in opposite directions with soft faded edges; hovering or focusing a row
     * stops it so it can be read, and it rests whenever it is off screen or the tab is hidden. The grid variant, and
     * anyone who prefers reduced motion, gets the same cards standing still.
     */
    export function Testimonials({ items, variant = "marquee", speed = 60, label = "What customers say", className }: TestimonialsProps) {
      const root = useRef<HTMLElement>(null);
      const [paused, setPaused] = useState(true);
    
      useEffect(() => {
        const el = root.current;
        if (!el || variant !== "marquee") return;
        let seen = false;
        const sync = () => setPaused(!seen || document.hidden);
        const io = new IntersectionObserver(([e]) => {
          seen = e.isIntersecting;
          sync();
        });
        io.observe(el);
        document.addEventListener("visibilitychange", sync);
        return () => {
          io.disconnect();
          document.removeEventListener("visibilitychange", sync);
        };
      }, [variant]);
    
      const half = Math.ceil(items.length / 2);
      const rows = [items.slice(0, half), items.slice(half).length ? items.slice(half) : items.slice(0, half)];
      const grid = (
        <div className={cx("asta-tm-still grid gap-3 @min-[560px]:grid-cols-2 @min-[860px]:grid-cols-3", variant === "marquee" && "hidden")}>
          {items.map((t, i) => (
            <Card key={t.name + i} t={t} />
          ))}
        </div>
      );
    
      return (
        <section ref={root} aria-label={label} data-paused={paused || undefined} className={cx("asta-tm-root @container w-full", className)}>
          <style href="asta-testimonials" precedence="asta">{KEYFRAMES}</style>
          {variant === "marquee" && (
            <div className="asta-tm-marquee flex flex-col gap-3 [mask-image:linear-gradient(90deg,transparent,#000_8%,#000_92%,transparent)]">
              {rows.map((row, r) => (
                <div key={r} className="asta-tm-row overflow-hidden">
                  {/* Two copies side by side; the track slides by one copy and starts over without a seam. */}
                  <ul
                    className="asta-tm-track flex w-max will-change-transform"
                    style={{ animation: `${r ? "asta-tm-right" : "asta-tm-left"} ${speed}s linear infinite` }}
                  >
                    {[0, 1].map((copy) =>
                      row.map((t, i) => (
                        <li key={`${copy}-${i}`} aria-hidden={copy === 1 || undefined} className="w-[300px] shrink-0 pr-3 sm:w-[340px]">
                          <Card t={t} className="h-full" />
                        </li>
                      )),
                    )}
                  </ul>
                </div>
              ))}
            </div>
          )}
          {grid}
        </section>
      );
    }
    
    export default Testimonials;
    
    "use client";
    
    import { useEffect, useRef, useState } from "react";
    import { Avatar } from "@/components/kit/base/avatar";
    
    const cx = (...c: (string | false | null | undefined)[]) => c.filter(Boolean).join(" ");
    
    const KEYFRAMES = `@keyframes asta-tm-left { to { transform: translateX(-50%) } }
    @keyframes asta-tm-right { from { transform: translateX(-50%) } to { transform: none } }
    .asta-tm-root[data-paused] .asta-tm-track, .asta-tm-row:hover .asta-tm-track, .asta-tm-row:focus-within .asta-tm-track { animation-play-state: paused }
    @media (prefers-reduced-motion: reduce) { .asta-tm-marquee { display: none !important } .asta-tm-still { display: grid !important } }`;
    
    export interface Testimonial {
      quote: string;
      name: string;
      /** Role and company, e.g. "Head of Product, Juniper Goods". */
      title?: string;
      avatar?: string;
      /** 1–5. Shows stars when set. */
      rating?: number;
    }
    
    export interface TestimonialsProps {
      items: Testimonial[];
      /** Two rows drifting in opposite directions, or a still grid. Reduced motion always gets the grid. */
      variant?: "marquee" | "grid";
      /** Seconds for one full loop of a row. */
      speed?: number;
      label?: string;
      className?: string;
    }
    
    function Card({ t, className }: { t: Testimonial; className?: string }) {
      return (
        <figure className={cx("flex flex-col justify-between gap-5 rounded-[12px] bg-paper-2 p-5", className)}>
          <div className="flex flex-col gap-3">
            {t.rating ? (
              <span className="flex gap-0.5 text-brand" role="img" aria-label={`${t.rating} out of 5`}>
                {Array.from({ length: 5 }, (_, i) => (
                  <svg key={i} viewBox="0 0 24 24" className={cx("h-3.5 w-3.5", i >= t.rating! && "opacity-25")} fill="currentColor" stroke="currentColor" strokeWidth="1.75" strokeLinejoin="round" aria-hidden>
                    <path d="m12 3.8 2.5 5.1 5.6.8-4 4 .9 5.6-5-2.7-5 2.7.9-5.6-4-4 5.6-.8Z" />
                  </svg>
                ))}
              </span>
            ) : null}
            <blockquote className="text-[14px] leading-relaxed text-ink">“{t.quote}”</blockquote>
          </div>
          <figcaption className="flex items-center gap-3">
            <Avatar name={t.name} src={t.avatar} size="sm" />
            <span className="min-w-0">
              <span className="block truncate text-[13px] font-medium">{t.name}</span>
              {t.title && <span className="block truncate text-[12px] text-mute">{t.title}</span>}
            </span>
          </figcaption>
        </figure>
      );
    }
    
    /**
     * Customer quotes. The marquee runs two rows in opposite directions with soft faded edges; hovering or focusing a row
     * stops it so it can be read, and it rests whenever it is off screen or the tab is hidden. The grid variant, and
     * anyone who prefers reduced motion, gets the same cards standing still.
     */
    export function Testimonials({ items, variant = "marquee", speed = 60, label = "What customers say", className }: TestimonialsProps) {
      const root = useRef<HTMLElement>(null);
      const [paused, setPaused] = useState(true);
    
      useEffect(() => {
        const el = root.current;
        if (!el || variant !== "marquee") return;
        let seen = false;
        const sync = () => setPaused(!seen || document.hidden);
        const io = new IntersectionObserver(([e]) => {
          seen = e.isIntersecting;
          sync();
        });
        io.observe(el);
        document.addEventListener("visibilitychange", sync);
        return () => {
          io.disconnect();
          document.removeEventListener("visibilitychange", sync);
        };
      }, [variant]);
    
      const half = Math.ceil(items.length / 2);
      const rows = [items.slice(0, half), items.slice(half).length ? items.slice(half) : items.slice(0, half)];
      const grid = (
        <div className={cx("asta-tm-still grid gap-3 @min-[560px]:grid-cols-2 @min-[860px]:grid-cols-3", variant === "marquee" && "hidden")}>
          {items.map((t, i) => (
            <Card key={t.name + i} t={t} />
          ))}
        </div>
      );
    
      return (
        <section ref={root} aria-label={label} data-paused={paused || undefined} className={cx("asta-tm-root @container w-full", className)}>
          <style href="asta-testimonials" precedence="asta">{KEYFRAMES}</style>
          {variant === "marquee" && (
            <div className="asta-tm-marquee flex flex-col gap-3 [mask-image:linear-gradient(90deg,transparent,#000_8%,#000_92%,transparent)]">
              {rows.map((row, r) => (
                <div key={r} className="asta-tm-row overflow-hidden">
                  {/* Two copies side by side; the track slides by one copy and starts over without a seam. */}
                  <ul
                    className="asta-tm-track flex w-max will-change-transform"
                    style={{ animation: `${r ? "asta-tm-right" : "asta-tm-left"} ${speed}s linear infinite` }}
                  >
                    {[0, 1].map((copy) =>
                      row.map((t, i) => (
                        <li key={`${copy}-${i}`} aria-hidden={copy === 1 || undefined} className="w-[300px] shrink-0 pr-3 sm:w-[340px]">
                          <Card t={t} className="h-full" />
                        </li>
                      )),
                    )}
                  </ul>
                </div>
              ))}
            </div>
          )}
          {grid}
        </section>
      );
    }
    
    export default Testimonials;
    
  4. Or ask your AI agent

    Paste this into Claude Code, Cursor, Codex, v0 or Lovable. Fill in the last line. More in Prompts.

    Add the Astabyte UI Testimonials component to my project.
    
    Customer quotes as a marquee or a grid.
    It includes: marquee, grid, pause on hover, edge fade, offscreen pause.
    
    Install it (Radix build):
    ```sh
    pnpm dlx asta-ui@latest add testimonials --radix
    ```
    Or with the shadcn CLI:
    ```sh
    pnpm dlx shadcn@latest add https://ui.astabyte.com/r/testimonials.json
    ```
    If the project isn't set up yet, run `pnpm dlx asta-ui@latest init --radix` first: it runs `shadcn init` when needed and adds the @astabyte registry (Next.js, Vite, React Router, Astro, TanStack Start; Tailwind CSS v4).
    
    Import it like this:
    ```tsx
    import { SegmentedControl } from "@/components/astabyte/segmented-control";
    import { Testimonials, type Testimonial } from "@/components/astabyte/testimonials";
    ```
    
    Usage example and props: https://ui.astabyte.com/testimonials
    Full catalogue for context: https://ui.astabyte.com/llms.txt
    
    Rules:
    - Keep the colour tokens (paper, paper-2, ink, ink-2, mute, brand). Don't restyle with hard-coded colours; rebrand by changing the token values in the CSS.
    - Keep the motion as it is: transform and opacity only, and the prefers-reduced-motion fallback.
    - Keep keyboard, focus and ARIA behaviour (interactive pieces are built on Radix primitives from the radix-ui package).
    - Stay on Radix: install other Astabyte UI components with `--radix` so the project uses one primitive library.
    - Use fake data and fake brand names in examples.
    
    Use it to: [describe where it goes and what it should do]
    Add the Astabyte UI Testimonials component to my project.
    
    Customer quotes as a marquee or a grid.
    It includes: marquee, grid, pause on hover, edge fade, offscreen pause.
    
    Install it (Base UI build):
    ```sh
    pnpm dlx asta-ui@latest add testimonials
    ```
    Or with the shadcn CLI:
    ```sh
    pnpm dlx shadcn@latest add https://ui.astabyte.com/r/base/testimonials.json
    ```
    If the project isn't set up yet, run `pnpm dlx asta-ui@latest init` first: it runs `shadcn init` when needed and adds the @astabyte registry (Next.js, Vite, React Router, Astro, TanStack Start; Tailwind CSS v4).
    
    Import it like this:
    ```tsx
    import { SegmentedControl } from "@/components/astabyte/segmented-control";
    import { Testimonials, type Testimonial } from "@/components/astabyte/testimonials";
    ```
    
    Usage example and props: https://ui.astabyte.com/testimonials
    Full catalogue for context: https://ui.astabyte.com/llms.txt
    
    Rules:
    - Keep the colour tokens (paper, paper-2, ink, ink-2, mute, brand). Don't restyle with hard-coded colours; rebrand by changing the token values in the CSS.
    - Keep the motion as it is: transform and opacity only, and the prefers-reduced-motion fallback.
    - Keep keyboard, focus and ARIA behaviour (interactive pieces are built on Base UI primitives from the @base-ui/react package).
    - Stay on Base UI: install other Astabyte UI components without `--radix` so the project uses one primitive library.
    - Use fake data and fake brand names in examples.
    
    Use it to: [describe where it goes and what it should do]
  5. Or use plain HTML + CSS

    Not on React? Use it from Django, Rails, Laravel, Go html/template, htmx or a static page. Load asta.css and asta.js once (the head.html tab), then paste the markup. The ui.astabyte.com/cdn link is temporary: pin a version from jsDelivr for production. More in HTML + CSS.

    <!-- Pure CSS. Each row holds its items twice (the copy aria-hidden) so it loops without a seam. Rows pause on hover. -->
    <section class="asta-testimonials" aria-label="What customers say">
    <div class="asta-testimonials-row"><ul class="asta-testimonials-track" style="--speed:60s"><li><figure class="asta-testimonial"><div><div class="asta-testimonial-stars" role="img" aria-label="5 out of 5">★★★★★</div><blockquote>“They shipped our checkout redesign in three weeks and conversion went up the first Monday.”</blockquote></div><figcaption><span class="asta-avatar asta-avatar-sm" role="img" aria-label="Ingrid Solberg"><span class="asta-avatar-face asta-avatar-brand">IS</span></span><span><b>Ingrid Solberg</b>Head of Product, Juniper Goods</span></figcaption></figure></li><li><figure class="asta-testimonial"><div><div class="asta-testimonial-stars" role="img" aria-label="5 out of 5">★★★★★</div><blockquote>“The design system they set up is the first one our engineers actually use.”</blockquote></div><figcaption><span class="asta-avatar asta-avatar-sm" role="img" aria-label="Kwame Asante"><span class="asta-avatar-face">KA</span></span><span><b>Kwame Asante</b>CTO, Fieldnote</span></figcaption></figure></li><li><figure class="asta-testimonial"><div><div class="asta-testimonial-stars" role="img" aria-label="5 out of 5">★★★★★</div><blockquote>“Clear weekly demos, no surprises on the invoice.”</blockquote></div><figcaption><span class="asta-avatar asta-avatar-sm" role="img" aria-label="Yuki Tanabe"><span class="asta-avatar-face asta-avatar-tint">YT</span></span><span><b>Yuki Tanabe</b>Founder, Northpeak</span></figcaption></figure></li><li aria-hidden="true"><figure class="asta-testimonial"><div><div class="asta-testimonial-stars" role="img" aria-label="5 out of 5">★★★★★</div><blockquote>“They shipped our checkout redesign in three weeks and conversion went up the first Monday.”</blockquote></div><figcaption><span class="asta-avatar asta-avatar-sm" role="img" aria-label="Ingrid Solberg"><span class="asta-avatar-face asta-avatar-brand">IS</span></span><span><b>Ingrid Solberg</b>Head of Product, Juniper Goods</span></figcaption></figure></li><li aria-hidden="true"><figure class="asta-testimonial"><div><div class="asta-testimonial-stars" role="img" aria-label="5 out of 5">★★★★★</div><blockquote>“The design system they set up is the first one our engineers actually use.”</blockquote></div><figcaption><span class="asta-avatar asta-avatar-sm" role="img" aria-label="Kwame Asante"><span class="asta-avatar-face">KA</span></span><span><b>Kwame Asante</b>CTO, Fieldnote</span></figcaption></figure></li><li aria-hidden="true"><figure class="asta-testimonial"><div><div class="asta-testimonial-stars" role="img" aria-label="5 out of 5">★★★★★</div><blockquote>“Clear weekly demos, no surprises on the invoice.”</blockquote></div><figcaption><span class="asta-avatar asta-avatar-sm" role="img" aria-label="Yuki Tanabe"><span class="asta-avatar-face asta-avatar-tint">YT</span></span><span><b>Yuki Tanabe</b>Founder, Northpeak</span></figcaption></figure></li></ul></div>
    <div class="asta-testimonials-row"><ul class="asta-testimonials-track asta-testimonials-track-reverse" style="--speed:60s"><li><figure class="asta-testimonial"><div><div class="asta-testimonial-stars" role="img" aria-label="5 out of 5">★★★★★</div><blockquote>“Every animation has a reason. Support tickets about ‘where did it go’ dropped to zero.”</blockquote></div><figcaption><span class="asta-avatar asta-avatar-sm" role="img" aria-label="Zainab Okoro"><span class="asta-avatar-face asta-avatar-soft">ZO</span></span><span><b>Zainab Okoro</b>Design director, Oakline</span></figcaption></figure></li><li><figure class="asta-testimonial"><div><div class="asta-testimonial-stars" role="img" aria-label="5 out of 5">★★★★★</div><blockquote>“They pushed back on two of our ideas and were right both times.”</blockquote></div><figcaption><span class="asta-avatar asta-avatar-sm" role="img" aria-label="Arjun Mehta"><span class="asta-avatar-face">AM</span></span><span><b>Arjun Mehta</b>COO, Brightmill</span></figcaption></figure></li><li><figure class="asta-testimonial"><div><div class="asta-testimonial-stars" role="img" aria-label="5 out of 5">★★★★★</div><blockquote>“Handover docs were so good we onboarded a new hire from them alone.”</blockquote></div><figcaption><span class="asta-avatar asta-avatar-sm" role="img" aria-label="Elif Kaya"><span class="asta-avatar-face asta-avatar-brand">EK</span></span><span><b>Elif Kaya</b>Product manager, Lumen Labs</span></figcaption></figure></li><li aria-hidden="true"><figure class="asta-testimonial"><div><div class="asta-testimonial-stars" role="img" aria-label="5 out of 5">★★★★★</div><blockquote>“Every animation has a reason. Support tickets about ‘where did it go’ dropped to zero.”</blockquote></div><figcaption><span class="asta-avatar asta-avatar-sm" role="img" aria-label="Zainab Okoro"><span class="asta-avatar-face asta-avatar-soft">ZO</span></span><span><b>Zainab Okoro</b>Design director, Oakline</span></figcaption></figure></li><li aria-hidden="true"><figure class="asta-testimonial"><div><div class="asta-testimonial-stars" role="img" aria-label="5 out of 5">★★★★★</div><blockquote>“They pushed back on two of our ideas and were right both times.”</blockquote></div><figcaption><span class="asta-avatar asta-avatar-sm" role="img" aria-label="Arjun Mehta"><span class="asta-avatar-face">AM</span></span><span><b>Arjun Mehta</b>COO, Brightmill</span></figcaption></figure></li><li aria-hidden="true"><figure class="asta-testimonial"><div><div class="asta-testimonial-stars" role="img" aria-label="5 out of 5">★★★★★</div><blockquote>“Handover docs were so good we onboarded a new hire from them alone.”</blockquote></div><figcaption><span class="asta-avatar asta-avatar-sm" role="img" aria-label="Elif Kaya"><span class="asta-avatar-face asta-avatar-brand">EK</span></span><span><b>Elif Kaya</b>Product manager, Lumen Labs</span></figcaption></figure></li></ul></div>
    </section>
    <section class="asta-testimonials" aria-label="What customers say, grid" style="margin-top:32px"><div class="asta-testimonials-grid"><figure class="asta-testimonial"><div><div class="asta-testimonial-stars" role="img" aria-label="5 out of 5">★★★★★</div><blockquote>“They shipped our checkout redesign in three weeks and conversion went up the first Monday.”</blockquote></div><figcaption><span class="asta-avatar asta-avatar-sm" role="img" aria-label="Ingrid Solberg"><span class="asta-avatar-face asta-avatar-brand">IS</span></span><span><b>Ingrid Solberg</b>Head of Product, Juniper Goods</span></figcaption></figure><figure class="asta-testimonial"><div><div class="asta-testimonial-stars" role="img" aria-label="5 out of 5">★★★★★</div><blockquote>“The design system they set up is the first one our engineers actually use.”</blockquote></div><figcaption><span class="asta-avatar asta-avatar-sm" role="img" aria-label="Kwame Asante"><span class="asta-avatar-face">KA</span></span><span><b>Kwame Asante</b>CTO, Fieldnote</span></figcaption></figure><figure class="asta-testimonial"><div><div class="asta-testimonial-stars" role="img" aria-label="5 out of 5">★★★★★</div><blockquote>“Clear weekly demos, no surprises on the invoice.”</blockquote></div><figcaption><span class="asta-avatar asta-avatar-sm" role="img" aria-label="Yuki Tanabe"><span class="asta-avatar-face asta-avatar-tint">YT</span></span><span><b>Yuki Tanabe</b>Founder, Northpeak</span></figcaption></figure><figure class="asta-testimonial"><div><div class="asta-testimonial-stars" role="img" aria-label="5 out of 5">★★★★★</div><blockquote>“Every animation has a reason. Support tickets about ‘where did it go’ dropped to zero.”</blockquote></div><figcaption><span class="asta-avatar asta-avatar-sm" role="img" aria-label="Zainab Okoro"><span class="asta-avatar-face asta-avatar-soft">ZO</span></span><span><b>Zainab Okoro</b>Design director, Oakline</span></figcaption></figure><figure class="asta-testimonial"><div><div class="asta-testimonial-stars" role="img" aria-label="5 out of 5">★★★★★</div><blockquote>“They pushed back on two of our ideas and were right both times.”</blockquote></div><figcaption><span class="asta-avatar asta-avatar-sm" role="img" aria-label="Arjun Mehta"><span class="asta-avatar-face">AM</span></span><span><b>Arjun Mehta</b>COO, Brightmill</span></figcaption></figure><figure class="asta-testimonial"><div><div class="asta-testimonial-stars" role="img" aria-label="5 out of 5">★★★★★</div><blockquote>“Handover docs were so good we onboarded a new hire from them alone.”</blockquote></div><figcaption><span class="asta-avatar asta-avatar-sm" role="img" aria-label="Elif Kaya"><span class="asta-avatar-face asta-avatar-brand">EK</span></span><span><b>Elif Kaya</b>Product manager, Lumen Labs</span></figcaption></figure></div></section>

Usage

The demo above, as code.

"use client";

import { useState } from "react";
import { SegmentedControl } from "@/components/astabyte/segmented-control";
import { Testimonials, type Testimonial } from "@/components/astabyte/testimonials";

const ITEMS: Testimonial[] = [
  { quote: "They shipped our checkout redesign in three weeks and conversion went up the first Monday.", name: "Ingrid Solberg", title: "Head of Product, Juniper Goods", rating: 5 },
  { quote: "The design system they set up is the first one our engineers actually use.", name: "Kwame Asante", title: "CTO, Fieldnote", rating: 5 },
  { quote: "Clear weekly demos, no surprises on the invoice. That is rarer than it should be.", name: "Yuki Tanabe", title: "Founder, Northpeak", rating: 5 },
  { quote: "Our dashboard finally loads before the coffee does.", name: "Tomasz Wrona", title: "Engineering lead, Tidewater", rating: 4 },
  { quote: "Every animation has a reason. Our support tickets about 'where did it go' dropped to zero.", name: "Zainab Okoro", title: "Design director, Oakline", rating: 5 },
  { quote: "They pushed back on two of our ideas and were right both times.", name: "Arjun Mehta", title: "COO, Brightmill", rating: 5 },
  { quote: "Handover docs were so good we onboarded a new hire from them alone.", name: "Elif Kaya", title: "Product manager, Lumen Labs", rating: 5 },
  { quote: "Fast, calm and very detailed. We'd hire them again tomorrow.", name: "Mateo Ferraz", title: "CEO, Coastline Travel", rating: 5 },
];

export default function TestimonialsDemo() {
  const [variant, setVariant] = useState<"marquee" | "grid">("marquee");
  return (
    <div className="flex min-h-[640px] w-full flex-col items-center justify-center gap-8 py-10">
      <div className="flex flex-col items-center gap-4 px-4 text-center">
        <h2 className="max-w-[520px] text-[28px] font-medium leading-tight tracking-[-0.04em]">Teams who build with Astabyte</h2>
        <SegmentedControl
          size="sm"
          label="Layout"
          value={variant}
          onChange={(v) => setVariant(v as "marquee" | "grid")}
          segments={[
            { value: "marquee", label: "Marquee" },
            { value: "grid", label: "Grid" },
          ]}
        />
      </div>
      <Testimonials items={ITEMS} variant={variant} className={variant === "grid" ? "max-w-[1040px] px-4" : ""} />
    </div>
  );
}