GooseUI

Components

Testimonial Rotator

New

Testimonials that change on their own. A ring around the active avatar shows how much time is left before the next one. The avatars are radio buttons: a click or the arrow keys pick a quote and restart the cycle from it. The rotation itself is one CSS animation shared by quotes, avatars and rings, so it pauses only while the cursor is over the avatar that is playing now, all without JavaScript. It is a Server Component.

Browser Support

:has()

Styles elements based on their contents

Your browser:
color-mix()

Colors the selected review controls

Your browser:
text-wrap: balance

Balances review text wrapping

Your browser:
transition-behavior

Animates the review change

Your browser:

Preview

Hover the current avatar to pause the rotation.

We replaced three internal tools with one dashboard. Onboarding a new teammate now takes an afternoon.
Lena HartOperations lead, Northwind Labs
The API is boring in the best way. It does what the docs say, every single time.
Marco SilvaBackend engineer, Fieldnote
Support answered faster than our own team chat. That alone made us stay.
Priya NairFounder, Little Orbit
We shipped the redesign two weeks early and nobody had to work a weekend.
Tom BeckerProduct manager, Quietbyte

Installation

npx shadcn@latest add @gooseui/testimonial-rotator
pnpm dlx shadcn@latest add @gooseui/testimonial-rotator
yarn dlx shadcn@latest add @gooseui/testimonial-rotator
bunx --bun shadcn@latest add @gooseui/testimonial-rotator

Usage

import { TestimonialRotator } from "@/components/ui/testimonial-rotator"

const items = [
  {
    quote: "We shipped the redesign two weeks early.",
    author: "Tom Becker",
    role: "Product manager, Quietbyte",
    avatar: "/avatars/tom-becker.webp",
  },
  {
    quote: "Support answered faster than our own team chat.",
    author: "Priya Nair",
    role: "Founder, Little Orbit",
    avatar: "/avatars/priya-nair.webp",
  },
]

export default function Example() {
  return <TestimonialRotator items={items} />
}

Examples

Avatars on the side

orientation="horizontal" puts the avatars in a column on the left from the md breakpoint. Here the interval is 4 seconds.

We replaced three internal tools with one dashboard. Onboarding a new teammate now takes an afternoon.
Lena HartOperations lead, Northwind Labs
The API is boring in the best way. It does what the docs say, every single time.
Marco SilvaBackend engineer, Fieldnote
Support answered faster than our own team chat. That alone made us stay.
Priya NairFounder, Little Orbit
We shipped the redesign two weeks early and nobody had to work a weekend.
Tom BeckerProduct manager, Quietbyte
<TestimonialRotator items={items} orientation="horizontal" interval={4000} />

Manual switching

With autoPlay={false} the quotes change only on click or with the arrow keys. The ring stays as a marker of the active avatar.

We replaced three internal tools with one dashboard. Onboarding a new teammate now takes an afternoon.
Lena HartOperations lead, Northwind Labs
The API is boring in the best way. It does what the docs say, every single time.
Marco SilvaBackend engineer, Fieldnote
Support answered faster than our own team chat. That alone made us stay.
Priya NairFounder, Little Orbit
<TestimonialRotator items={items} autoPlay={false} defaultIndex={1} />

Photos and custom avatars

Pass a square photo URL (160px is enough for the 56px avatar at 2x) or any node in avatar. The photo is a round <img> with lazy loading: inactive ones are dimmed, the active one is at full brightness inside the progress ring. Without avatar the component draws initials on a colored background.

const items = [
  { quote: "…", author: "Lena Hart", avatar: "/avatars/lena-hart.webp" },
  { quote: "…", author: "Marco Silva", avatar: <UserIcon className="size-5" /> },
  { quote: "…", author: "Priya Nair" }, // initials "PN"
]

<TestimonialRotator
  items={items}
  labels={{ show: (author) => `Read ${author}`, region: "Customer stories" }}
/>

Props

PropTypeDefaultDescription
itemsTestimonial[]-List of testimonials
intervalnumber6000Time per testimonial in ms
autoPlaybooleantrueSwitch testimonials automatically
defaultIndexnumber0Testimonial shown first
namestringuseId()Name of the radio group. Generated when omitted
orientation"vertical" | "horizontal""vertical"Avatars below the quote or in a column on the left
labelsPartial<TestimonialRotatorLabels>-Texts: show(author) for the avatar radios, region for the section
classNamestring-Additional CSS classes

Testimonial

PropTypeDefaultDescription
quoteReactNode-Quote text
authorstring-Author name, also used for initials
roleReactNode-Position, company or any caption
avatarstring | ReactNodeinitialsSquare photo URL (160px or more) or a custom node. Falls back to initials

Features

  • No JavaScript: radio buttons and one CSS animation, a Server Component
  • Progress ring: the SVG ring fills up until the next switch
  • Pause: only on hover over the avatar that is playing now
  • Reduced motion: with prefers-reduced-motion automatic switching is off
  • Keyboard: the avatars are a radio group: Tab to enter, arrows to switch