Skip to content

Testimonial Carousel

A smooth, animated carousel for displaying customer testimonials with drag support and autoplay.

Installation

1https://ui.sanjid.shop/r/testimonial-carousel.json

Props

PropTypeRequiredDefaultDescription
testimonialsTestimonial[]Yes[]Array of testimonial objects to display
autoPlayIntervalnumberNo5000Interval in milliseconds for autoplay (default: 5000)
classNamestringNoOptional class name to append to the root element

Types

1interface Testimonial {2  id: number;3  name: string;4  role: string;5  text: string;6  avatar: string;7}

Usage

1"use client";2
3import { TestimonialCarousel } from "@/components/ui/testimonial-carousel";4
5const testimonials = [6  {7    id: 1,8    name: "Alice Johnson",9    role: "Product Designer",10    text: "This library has completely transformed the way we build UI. The animations feel premium and smooth.",11    avatar: "https://i.pravatar.cc/100?img=1",12  },13  {14    id: 2,15    name: "David Kim",16    role: "Full Stack Developer",17    text: "I love how reusable and consistent the components are. Saved us weeks of dev time.",18    avatar: "https://i.pravatar.cc/100?img=2",19  },20  {21    id: 3,22    name: "Sophia Lee",23    role: "UX Researcher",24    text: "The attention to detail in animations and responsiveness is simply top-notch.",25    avatar: "https://i.pravatar.cc/100?img=3",26  },27];28
29export default function Page() {30  return (31    <div className="flex min-h-screen items-center justify-center bg-neutral-100 dark:bg-neutral-900">32      <TestimonialCarousel testimonials={testimonials} />33    </div>34  );35}

Customization

You can easily customize the testimonials by modifying the data structure:

1const customTestimonials = [2  {3    id: 1,4    name: "Your Customer",5    role: "Their Role",6    text: "Your testimonial text here...",7    avatar: "/path/to/avatar.jpg",8  },9  // ... more testimonials10];

The component uses Tailwind CSS classes and can be customized by overriding the default styles:

1<TestimonialCarousel className="max-w-2xl" testimonials={testimonials} />

Features

  • Smooth Framer Motion animations with spring transitions
  • Drag and drop support for mobile devices
  • Autoplay with pause on hover
  • Keyboard navigation support
  • Responsive design
  • Light/Dark mode support
  • Customizable testimonial data structure
  • Accessible navigation controls
  • Touch-friendly interactions

Build your next big idea with us

From lightning-fast landing pages to fully functional SaaS products, we turn your vision into reality. Book a call today and let's make something extraordinary.

They transformed our idea into a fully functional product in record time. Couldn't be happier!

Alex Chen

Founder, StartupX

The team's attention to detail and design expertise set our product apart in the market.

Sarah Kim

CTO, Innovate Inc