UIPin
ComponentsIconsIllustrationsMotionTemplatesApps
Boards
UIPin

Free, open-source UI components, icons, illustrations, motion, templates and apps, in one search. Every item links to its source and licence.

UIPin is free. If it saved you time, you can keep it running:

Buy me a coffee
ComponentsIconsIllustrationsMotionTemplatesAppsLibrariesCompareNew this weekMCP for agentsBoardsPrivacy

Components, icons and artwork belong to their authors and are shown under their open-source licences.

SmoothUI/Testimonials 2

Cards
1 of 3
Compiling

Theme it

Every preview, live

Brand colour

Corner radius

Font

Recolours shadcn’s tokens, Tailwind’s accent colours and colours set in the code. Red, amber and green classes stay, since they usually mean error, warning or success.

3 versions·1 library

  • Testimonials 2
  • Testimonials 1
  • Testimonials 3

Testimonials 2

Grid testimonials block with navigation arrows

npx shadcn@latest add https://smoothui.dev/r/testimonials-2.json
Open in v0 Docs Repo
Library
SmoothUI
License
MIT
Stack
React · Tailwind CSS · animated · base-ui
Packages
@base-ui/reactclass-variance-authoritylucide-reactmotion
Also adds
index, app-icons, cast, component-meta, people, products, scenes, smoothui-schema
Size
238 lines

Code

components/smoothui/testimonials-2/index.tsx

"use client";

import { Avatar } from "@/components/smoothui/avatar";
import SmoothButton from "@/components/smoothui/smooth-button";
import { getAvatarUrl, getTestimonials } from "@/lib/smoothui-data";
import { ChevronLeft, ChevronRight } from "lucide-react";
import { AnimatePresence, motion, useReducedMotion } from "motion/react";
import { useCallback, useEffect, useState } from "react";

const testimonials = getTestimonials(7);

export function TestimonialsGrid() {
  const shouldReduceMotion = useReducedMotion();
  const [active, setActive] = useState(0);
  const [autoplay] = useState(false);

  const handleNext = useCallback(() => {
    setActive((prev) => (prev + 1) % testimonials.length);
  }, []);

  const handlePrev = () => {
    setActive((prev) => (prev - 1 + testimonials.length) % testimonials.length);
  };

  const isActive = (index: number) => index === active;

  useEffect(() => {
    if (autoplay) {
      const interval = setInterval(handleNext, 5000);
      return () => clearInterval(interval);
    }
  }, [autoplay, handleNext]);

  return (
    <section>
      <div className="min-h-auto bg-muted py-24">
        <div className="container mx-auto w-full max-w-6xl px-6">
          <motion.div
            animate={shouldReduceMotion ? { opacity: 1 } : { opacity: 1, y: 0 }}
            className="mb-12"
            initial={
              shouldReduceMotion ? { opacity: 1 } : { opacity: 0, y: 20 }
            }
            transition={
              shouldReduceMotion
                ? { duration: 0 }
                : { duration: 0.6, ease: [0.22, 1, 0.36, 1] }
            }
          >
            {/* Layout: Title on left, Testimonial on right */}
            <div className="grid grid-cols-1 gap-8 lg:grid-cols-2 lg:gap-12">
              {/* Left side - Title and description */}
              <div className="flex flex-col justify-center">
                <h2 className="mb-4 font-semibold text-4xl text-foreground">
                  What Developers Say
                </h2>
                <p className="text-balance text-foreground/70 text-lg">
                  Join thousands of developers who are building faster, more
                  beautiful UIs with SmoothUI. See what they&apos;re saying
                  about their experience.
                </p>
              </div>
              {/* Right side - Testimonial card */}
              <div className="relative flex min-h-fit flex-col items-end">
                {/* Navigation Arrows - Above the card */}
                <div className="mb-4 flex justify-center gap-2">
                  <SmoothButton
                    aria-label="Previous testimonial"
                    className="group/button shadow-lg"
                    onClick={handlePrev}
                    shape="pill"
                    size="icon-sm"
                    type="button"
                    variant="outline"
                  >
                    <ChevronLeft className="h-5 w-5 text-foreground transition-transform duration-300 group-hover/button:-rotate-12" />
                  </SmoothButton>
                  <SmoothButton
                    aria-label="Next testimonial"
                    className="group/button shadow-lg"
                    onClick={handleNext}
                    shape="pill"
                    size="icon-sm"
                    type="button"
                    variant="outline"
                  >
                    <ChevronRight className="h-5 w-5 text-foreground transition-transform duration-300 group-hover/button:rotate-12" />
                  </SmoothButton>
                </div>
                <div className="relative h-full w-full max-w-md">
                  <AnimatePresence>
                    {testimonials.map((testimonial, index) => (
                      <motion.div
                        animate={
                          shouldReduceMotion
                            ? { opacity: isActive(index) ? 1 : 0 }
                            : {
                                opacity: isActive(index) ? 1 : 0,
                                scale: isActive(index) ? 1 : 0.95,
                                y: isActive(index) ? 0 : 30,
                              }
                        }
                        className={`absolute inset-0 min-h-fit ${isActive(index) ? "z-10" : "z-0"}`}
                        exit={
                          shouldReduceMotion
                            ? { opacity: 0, transition: { duration: 0 } }
                            : {
                                opacity: 0,
                                scale: 0.9,
                                y: -30,
                              }
                        }
                        initial={
                          shouldReduceMotion
                            ? { opacity: 0 }
                            : {
                                opacity: 0,
                                scale: 0.9,
                                y: 30,
                              }
                        }
                        key={testimonial.name}
                        transition={
                          shouldReduceMotion
                            ? { duration: 0 }
                            : {
                                duration: 0.4,
                                ease: "easeInOut",
                              }
                        }
                      >
                        <div className="rounded-2xl border bg-background px-6 py-6 shadow-lg transition-all duration-200">
                          <motion.p
                            animate={
                              shouldReduceMotion
                                ? { opacity: 1 }
                                : { opacity: 1, y: 0 }
                            }
                            className="mb-6 text-foreground text-lg"
                            initial={
                              shouldReduceMotion
                                ? { opacity: 1 }
                                : { opacity: 0, y: 10 }
                            }
                            key={active}
                            transition={
                              shouldReduceMotion
                                ? { duration: 0 }
                                : { duration: 0.3 }
                            }
                          >
                            {(testimonial.content || "")
                              .split(" ")
                              .map((word, wordIndex) => (
                                <motion.span
                                  animate={
                                    shouldReduceMotion
                                      ? { opacity: 1 }
                                      : {
                                          filter: "blur(0px)",
                                          opacity: 1,
                                          y: 0,
                                        }
                                  }
                                  className="inline-block"
                                  initial={
                                    shouldReduceMotion
                                      ? { opacity: 1 }
                                      : {
                                          filter: "blur(4px)",
                                          opacity: 0,
                                          y: 5,
                                        }
                                  }
                                  key={`${testimonial.name}-word-${wordIndex}`}
                                  transition={
                                    shouldReduceMotion
                                      ? { duration: 0 }
                                      : {
                                          delay: wordIndex * 0.02,
                                          duration: 0.2,
                                          ease: "easeInOut",
                                        }
                                  }
                                >
                                  {word}&nbsp;
                                </motion.span>
                              ))}
                          </motion.p>
                          <motion.div
                            animate={
                              shouldReduceMotion
                                ? { opacity: 1 }
                                : { opacity: 1, y: 0 }
                            }
                            className="flex items-center gap-3"
                            initial={
                              shouldReduceMotion
                                ? { opacity: 1 }
                                : { opacity: 0, y: 10 }
                            }
                            transition={
                              shouldReduceMotion
                                ? { duration: 0 }
                                : { delay: 0.2, duration: 0.3 }
                            }
                          >
                            <Avatar
                              alt={testimonial.name}
                              className="size-8 overflow-hidden rounded-full shadow"
                              fallback={testimonial.name.charAt(0)}
                              src={getAvatarUrl(testimonial.avatar, 64)}
                            />
                            <div>
                              <div className="font-semibold text-foreground">
                                {testimonial.name}
                              </div>
                              <span className="text-muted-foreground text-sm">
                                {testimonial.role}
                              </span>
                            </div>
                          </motion.div>
                        </div>
                      </motion.div>
                    ))}
                  </AnimatePresence>
                </div>
              </div>
            </div>
          </motion.div>
        </div>
      </div>
    </section>
  );
}

export default TestimonialsGrid;

More like this

Team 2

SmoothUI·Page sections

Accordion

shadcn/ui·Data display

Ai Sources

SmoothUI·Text effects

Questionnaire

HextaUI·Inputs & forms

Ai Diff Review

Kokonut UI·Other

Transition Panel

Motion Primitives·Other

Bento Grid

Magic UI·Cards

Testimonials 1

SmoothUI·Cards

Logo Timeline

Eldora UI·Media & 3D

Page Transition

Animate UI·NavigationMIT+

Github Inline Comments

Eldora UI·Other

Floating 3D Particles

Magic UI·Backgrounds

Collapsible

HextaUI·Data display

Cta 1

SmoothUI·Page sections

Header 5

SmoothUI·Navigation