Search documentation v0.10.1

Reviews

Display user feedback, ratings, and testimonials about a product or service

Source Report Issue

Use the Reviews component to help users make informed decisions before purchase by displaying user ratings and reviews about a product or service. The component can be fully translated and customized in many ways:

Preview
Showing 3 reviews
  • Avatar
    Jonathan ★★★★★ Rated for Product Quality
    2025. 02. 15.
    Absolutely fantastic product! The quality exceeded my expectations, and the customer support was super helpful. Highly recommend!
    Verified review
    Loved the most
    • Excellent build quality
    • Fast shipping
    • Customer service
    Disliked the most
    • None
  • Avatar
    Sarah ★★★ ★★ Rated for Usability
    2025. 02. 13.
    Decent product but had some issues. The design is nice, but I faced some durability concerns after a few weeks of use.
    Verified review
    Loved the most
    • Aesthetic design
    • Easy to use
    Disliked the most
    • Durability issues
    • Slightly overpriced
  • Avatar
    Mark ★★★★ Rated for Customer Service
    2025. 02. 07.
    Really disappointed. The item arrived damaged, and customer service was unresponsive. Would not buy again.
    Verified review
    Disliked the most
    • Arrived damaged
    • Customer service
    • Low quality
Unlock code
How to use the Reviews component in Astro
---
import { reviews, reviewSummary, reviewButtons } from '@data'
---
<Reviews
reviewCountTitle="Showing {0} reviews"
verifiedText="Verified review"
reviews={reviews}
summary={reviewSummary}
reviewButtons={reviewButtons}
mostHelpful={reviews[0]}
/>
Unlock code
How to pass reviews for the component
export const reviews = [
{
name: 'Jonathan',
date: '2025. 02. 15.',
description: 'Absolutely fantastic product!',
rating: {
score: 5,
color: 'var(--w-color-warning)',
emptyColor: 'var(--w-color-primary-30)',
outline: false
},
avatar: {
img: 'avatar.png'
},
ratedFor: 'Rated for <b>Product Quality</b>',
positives: [
'Excellent build quality',
'Fast shipping',
'Customer service'
],
negatives: [
'None'
]
},
{ ... },
{ ... }
]
Unlock code
How to customize the review summary
export const reviewSummary = {
subText: 'Based on {0} reviews',
description: 'Help users make informed decisions. Share your experience with this product.',
rating: {
color: 'var(--w-color-warning)',
emptyColor: 'var(--w-color-primary-30)',
outline: false
},
colors: [
'var(--w-color-alert)',
'var(--w-color-alert)',
'var(--w-color-warning)',
'var(--w-color-success)',
'var(--w-color-success)'
],
cta: {
text: 'Write a review'
}
}
Unlock code
How to define review buttons
export const reviewButtons = [{
icon: replyIcon, // Import your icon as SVG
text: 'Reply',
theme: 'flat'
}, { ... }, { ... }]

The component expects a single prop called reviews that defines user reviews in as an array of objects. A review object must have the following properties:

The other props are optional and can be used to display additional data. The above example uses the following additional props that are options:

Default Style

If only the required prop is provided for the component, all elements will use default styles. Passing only the reviews prop will render the component in the following way:

Default settings
  • Avatar
    Jonathan ★★★★★ Rated for Product Quality
    2025. 02. 15.
    Absolutely fantastic product! The quality exceeded my expectations, and the customer support was super helpful. Highly recommend!
    Loved the most
    • Excellent build quality
    • Fast shipping
    • Customer service
    Disliked the most
    • None
  • Avatar
    Sarah ★★★ ★★ Rated for Usability
    2025. 02. 13.
    Decent product but had some issues. The design is nice, but I faced some durability concerns after a few weeks of use.
    Loved the most
    • Aesthetic design
    • Easy to use
    Disliked the most
    • Durability issues
    • Slightly overpriced
  • Avatar
    Mark ★★★★ Rated for Customer Service
    2025. 02. 07.
    Really disappointed. The item arrived damaged, and customer service was unresponsive. Would not buy again.
    Disliked the most
    • Arrived damaged
    • Customer service
    • Low quality
Unlock code
You can use the component with only a reviews prop
---
import Reviews from '@blocks/Reviews/Reviews.astro'
import { reviews } from '@data'
---
<Reviews reviews={reviews} />

Many of the props of a Review object are also optional. Only date, name, description, and rating.score are required fields:

Reviews with only required fields
  • Jonathan ★★★★★
    2025. 02. 15.
    Absolutely fantastic product! The quality exceeded my expectations, and the customer support was super helpful. Highly recommend!
  • Sarah ★★★ ★★
    2025. 02. 13.
    Decent product but had some issues. The design is nice, but I faced some durability concerns after a few weeks of use.
  • Mark ★★★★
    2025. 02. 07.
    Really disappointed. The item arrived damaged, and customer service was unresponsive. Would not buy again.
Unlock code
Reviews with only required fields
---
import Reviews from '@blocks/Reviews/Reviews.astro'
const reviews = [
{
name: 'Jonathan',
date: '2025. 02. 15.',
description: 'Absolutely fantastic product!',
rating: {
score: 5
}
},
{ ... },
{ ... }
]
---
<Reviews reviews={reviews} />

Summary

The summary for the reviews is automatically calculated using the reviews prop. However, you can customize this section by specifying the summary prop on the component with the following properties:

Unlock code
How to customize the summary section
---
import Reviews from '@blocks/Reviews/Reviews.astro'
const summary = {
show: true,
subText: 'Based on {0} reviews',
description: 'Help users make informed decisions.'
rating: {
color: 'var(--w-color-warning)',
emptyColor: 'var(--w-color-primary-30)',
outline: false
},
colors: [
'var(--w-color-alert)',
'var(--w-color-alert)',
'var(--w-color-warning)',
'var(--w-color-success)',
'var(--w-color-success)'
],
cta: {
text: 'Write a review'
}
}
---
<Reviews
reviews={reviews}
summary={summary}
/>
Reviews with customized summary
  • Avatar
    Jonathan ★★★★★ Rated for Product Quality
    2025. 02. 15.
    Absolutely fantastic product! The quality exceeded my expectations, and the customer support was super helpful. Highly recommend!
    Loved the most
    • Excellent build quality
    • Fast shipping
    • Customer service
    Disliked the most
    • None
  • Avatar
    Sarah ★★★ ★★ Rated for Usability
    2025. 02. 13.
    Decent product but had some issues. The design is nice, but I faced some durability concerns after a few weeks of use.
    Loved the most
    • Aesthetic design
    • Easy to use
    Disliked the most
    • Durability issues
    • Slightly overpriced
  • Avatar
    Mark ★★★★ Rated for Customer Service
    2025. 02. 07.
    Really disappointed. The item arrived damaged, and customer service was unresponsive. Would not buy again.
    Disliked the most
    • Arrived damaged
    • Customer service
    • Low quality

Most Helpful Review

Under the summary, a single review can be highlighted that can be used as the most helpful review for potential customers. This section can be configured using the mostHelpful and mostHelpfulTitle (defaults to “Most helpful review”) props:

Unlock code
How to highlight a review
---
import Reviews from '@blocks/Reviews/Reviews.astro'
const reviews = [
{ ... },
{ ... },
{ ... }
]
---
<Reviews
reviews={reviews}
mostHelpful={reviews[0]} {/* Expects a review object */}
mostHelpfulTitle="Rated as top review"
/>

API

Unlock code
Component API reference
type Review = {
date: string
name: string
description: string
rating: RatingProps
avatar?: AvatarProps
ratedFor?: string
positives?: string[]
negatives?: string[]
}
type ReviewsProps = {
reviews: Review[]
reviewButtons?: ({
text: string
icon?: string
} & ButtonProps)[]
reviewCountTitle?: string
verifiedText?: string
positiveTitle?: string
negativeTitle?: string
summary?: {
show?: boolean
subText?: string
description?: string
colors?: string[]
rating?: Omit<RatingProps, 'score'>
cta?: ({
text: string
icon?: string
} & ButtonProps)
}
mostHelpful?: Review
mostHelpfulTitle?: string
className?: string
}
Please see the documentation of the Avatar, Button, and Rating components for the other types.
Single review propsPurpose
date Sets the date of the review.
name Sets the name of the reviewer.
description Sets the review text.
rating Sets the rating. Accepts the props of a Rating component.
avatar Sets an avatar for the reviewer. Accepts the props of an Avatar component.
ratedFor Sets additional text after the rating. For example: "Rated for <category>".
positives Pass an array of strings to set a list of positive mentions.
negatives Pass an array of strings to set a list of negative mentions.
Component propsPurpose
reviews Sets a list of user reviews.
reviewButtons Sets a list of buttons under the review text. Here you can define common actions such as "Report".
reviewButtons.text Sets the label for the review button.
reviewButtons.icon Sets an icon for the review button. You can pass SVG strings, or an icon type for Astro components.
reviewCountTitle Sets a title above the list of reviews. Use the {0} placeholder to inject the amount of reviews.
verifiedText Sets a text under the review, and above the review buttons with a check mark icon.
positiveTitle Sets the title of the positive mentions. Defaults to "Loved the most".
negativeTitle Sets the title of the negative mentions. Defaults to "Disliked the most".
summary.show Shows a summary of reviews. Defaults to true.
summary.subText Sets additional text under the review summary. Use the {0} placeholder to inject the amount of reviews.
summary.description Sets text under the summary list. Supports HTML.
summary.colors Pass an array of strings to customize the color of each star rating in the summary table.
summary.rating Sets the style of the summary stars. Accepts the props of a Rating component.
summary.cta Displays a CTA at the end of your summary.
mostHelpful Pass a Review object to highlight a review under the summary.
mostHelpfulTitle Sets the title of the most helpful review. Defaults to "Most helpful review".
className Pass additional CSS classes for your Reviews component.