Reusables

Animated Review Card

A customizable, interactive review card with drag/click interactions, auto-rotation, and multiple themes.

Installation

npx shadcn@latest add "https://reusables.vercel.app/r/animated-review-cards"

Usage

import { AnimatedReviewCards } from "@/components/ui/animated-review-cards"
 
const reviews = [
  {
    id: 1,
    name: "John Doe",
    avatar: "https://example.com/avatar.jpg",
    text: "Great product! Highly recommended.",
    rating: 5,
  },
]
 
export default function ReviewSection() {
  return <AnimatedReviewCards reviews={reviews} />
}

Examples

Basic Usage

J

James Bryan

Dorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam eu turpis molestie, dictum est a, mattis tellus. Sed dignissim, metus nec fringilla accumsan, risus sem sollicitudin lacus, ut interdum tellus elit sed risus.

K

Keith Johnson

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

M

Mark Sloan

Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Click Interaction

Use click instead of drag to navigate through reviews.

J

James Bryan

Dorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam eu turpis molestie, dictum est a, mattis tellus. Sed dignissim, metus nec fringilla accumsan, risus sem sollicitudin lacus, ut interdum tellus elit sed risus.

K

Keith Johnson

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

M

Mark Sloan

Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Auto Rotation

Enable automatic rotation through reviews with customizable interval.

Interval:
J

James Bryan

Dorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam eu turpis molestie, dictum est a, mattis tellus. Sed dignissim, metus nec fringilla accumsan, risus sem sollicitudin lacus, ut interdum tellus elit sed risus.

K

Keith Johnson

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

M

Mark Sloan

Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Themes

Choose from multiple pre-built themes.

J

James Bryan

Dorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam eu turpis molestie, dictum est a, mattis tellus. Sed dignissim, metus nec fringilla accumsan, risus sem sollicitudin lacus, ut interdum tellus elit sed risus.

K

Keith Johnson

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

M

Mark Sloan

Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

V0 Known Issue

Incase you want to open in V0, it doesn’t support cssVars or Tailwind properties. Please see shadcn/ui for more details.

To enable border-beam to function as expected, you need to instruct V0 to add the following animation config to tailwind.config.js file:

module.exports = {
  theme: {
    extend: {
      keyframes: {
        "border-beam": {
          "100%": {
            "offset-distance": "100%",
          },
        },
      },
      animation: {
        "border-beam": "border-beam calc(var(--duration)*1s) infinite linear",
      },
    },
  },
}

API Reference

AnimatedReviewCards Props

PropTypeDefault
reviews
Review[]
-
interactionType
"drag" | "click"
"drag"
animationDuration
number
0.3
scaleStep
number
0.05
verticalSpacing
number
10
horizontalSpacing
number
20
autoRotate
boolean
true
rotateInterval
number
6000
theme
"default" | "primary" | "elegant" | "vibrant" | "minimal"
"default"
showBorderBeam
boolean
true

Review Object

PropTypeDefault
id
number | string
-
name
string
-
avatar
string
-
text
string
-
rating
number
-

ClassNames

PropTypeDefault
container
string
-
card
string
-
cardContent
string
-
header
string
-
avatar
string
-
name
string
-
text
string
-
rating
string
-
star
string
-
activeStarColor
string
-
inactiveStarColor
string
-
Edit on GitHub

Last updated on

On this page