We use cookies to ensure you get the best experience on our website. Read our privacy policy

Skip to main content

Directory

Reviews Section

The Reviews section component creates an engaging, auto-scrolling testimonial showcase with smooth animations and interactive hover effects. Perfect for displaying social proof and customer feedback in a modern, dynamic way.

Key features of the Reviews section:

  • Infinite smooth scrolling animation
  • Pause on hover interaction
  • Responsive card design
  • Automatic content duplication for seamless loops
  • GSAP-powered animations
  • Accessible structure
---
import Reviews from '@/components/NST-components/sections/reviews/Reviews.astro';
import { reviewsData } from './your-reviews-data';
---
<Reviews data={reviewsData} />

The Reviews component expects an array of review objects with the following structure:

interface Review {
author: string;
role: string;
content: string;
image: string;
}
const reviews: Review[] = [
{
author: 'Sarah Johnson',
role: 'Marketing Director',
content: 'This product has transformed how we work. Absolutely incredible results!',
image: '/testimonials/person1.jpg',
},
// ... additional reviews
];

The component implements smooth, continuous scrolling using GSAP:

  • Automatic calculation of scroll speed based on content width
  • Seamless infinite loop through content duplication
  • Smooth acceleration and deceleration
  • Performance-optimized using will-change transform
// Animation automatically pauses on hover
reviewsTrack.addEventListener('mouseenter', () => {
// Smooth pause transition
});
reviewsTrack.addEventListener('mouseleave', () => {
// Smooth resume transition
});
<Reviews class="custom-reviews-section" cardClass="custom-review-card" />
.custom-reviews-section {
--review-card-width: 400px;
--review-card-gap: 2rem;
--review-scroll-speed: 50;
--review-gradient-fade: 15%;
}
  • Proper image alt text for reviewer photos
  • Semantic HTML structure
  • Reduced motion support
  • ARIA labels for dynamic content
  • Keyboard pause controls
  1. Content Guidelines

    • Keep testimonials concise and impactful
    • Include authentic reviewer details
    • Use high-quality profile images
    • Maintain consistent content length
  2. Visual Presentation

    • Ensure readable text contrast
    • Optimize image sizes
    • Maintain consistent card heights
    • Use appropriate spacing
  3. Performance Optimization

    • Lazy load images
    • Optimize animation performance
    • Consider reduced motion preferences
    • Monitor scroll performance
<Reviews>
<template slot="review-card">
{
(review) => (
<div class="custom-review-layout">
<img src={review.image} alt={review.author} />
<div class="content">
<p>{review.content}</p>
<cite>{review.author}</cite>
</div>
</div>
)
}
</template>
</Reviews>
<Reviews scrollSpeed={75} Adjust scroll speed pauseOnHover={false} Disable pause on hover />

The component uses GSAP for smooth animations:

const scrollTween = gsap.to(reviewsTrack, {
x: `-${totalWidth}px`,
duration: totalWidth / scrollSpeed,
ease: 'none',
repeat: -1,
});

Limited Time Launch Sale

Start showcasing customer testimonials with style. Get our AstroJS starter template now and implement engaging review sections in minutes.

GET 60% OFF!
North Star Themes Logo

Subscribe to our newsletter

Get the latest AstroJS tips and tricks right to your inbox

Email: [email protected]

© 2025 North Star Themes

Web Kit Provided By North Star Themes