{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "shake-testimonial-card", "title": "Shake Testimonial Card", "description": "An eye-catching testimonial card with playful animations.", "dependencies": [ "motion", "@hugeicons/core-free-icons", "@hugeicons/react", "clsx", "tailwind-merge" ], "files": [ { "path": "registry/default/example/shake-testimonial-card.tsx", "content": "\"use client\";\r\n\r\nimport React, { useState, useEffect, useCallback } from \"react\";\r\nimport { motion, AnimatePresence } from \"motion/react\";\r\nimport { cn } from \"@/lib/utils\";\r\n\r\ninterface Testimonial {\r\n id: number;\r\n name: string;\r\n role: string;\r\n avatar: string;\r\n content: string;\r\n color: string;\r\n textColor: string;\r\n}\r\n\r\n// Change Here\r\nconst testimonials: Testimonial[] = [\r\n {\r\n id: 1,\r\n name: \"Marcus Thorne\",\r\n role: \"Head of Product, EcoStream\",\r\n avatar: \"/ui/memoji/1.svg\",\r\n content:\r\n \"The interface is so intuitive that our team was up and running in hours. Highly recommended for fast-moving startups.\",\r\n color: \"#E0F2FE\",\r\n textColor: \"#1E3A8A\",\r\n },\r\n {\r\n id: 2,\r\n name: \"Elena Rodriguez\",\r\n role: \"Director of UX, CreativeFlow\",\r\n avatar: \"/ui/memoji/6.svg\",\r\n content:\r\n \"We've tried dozens of tools, but this one stands out for its elegant design. It's a game-changer for our workflow.\",\r\n color: \"#F3E8FF\",\r\n textColor: \"#581C87\",\r\n },\r\n {\r\n id: 3,\r\n name: \"Sarah Jenkins\",\r\n role: \"CEO, TechNova\",\r\n avatar: \"/ui/memoji/4.svg\",\r\n content:\r\n \"Scaling our infrastructure used to be a nightmare until we found this platform. Now we can focus on building features.\",\r\n color: \"#DCFCE7\",\r\n textColor: \"#064E3B\",\r\n },\r\n {\r\n id: 4,\r\n name: \"David Kim\",\r\n role: \"CTO, NextGen Solutions\",\r\n avatar: \"/ui/memoji/6.svg\",\r\n content:\r\n \"The security features alone are worth every penny. Our clients feel safer knowing their data is protected by encryption.\",\r\n color: \"#FEF9C3\",\r\n textColor: \"#713F12\",\r\n },\r\n];\r\n\r\nexport default function ShakeTestimonial() {\r\n const [cards, setCards] = useState(testimonials);\r\n const [isAnimating, setIsAnimating] = useState(false);\r\n\r\n const handleNext = useCallback(() => {\r\n if (isAnimating) return;\r\n setIsAnimating(true);\r\n\r\n setTimeout(() => {\r\n setCards((prev) => {\r\n const [first, ...rest] = prev;\r\n return [...rest, first];\r\n });\r\n setIsAnimating(false);\r\n }, 600);\r\n }, [isAnimating]);\r\n\r\n useEffect(() => {\r\n const interval = setInterval(() => {\r\n handleNext();\r\n }, 1500);\r\n return () => clearInterval(interval);\r\n }, [handleNext]);\r\n\r\n return (\r\n
\r\n {card.role}\r\n
\r\n\r\n \"{card.content}\"\r\n
\r\n