Skip to content

Review

Review Component

The Review component displays a product review including a headline, rating, comments, and voting options.

Example

Great product, highly recommend!

This product exceeded my expectations. The quality is excellent and it works perfectly for my needs.

May 5, 2025by John Doe

Was this review helpful?

Usage

import Review, { VoteType } from "@altitude/ui/react/blocks/review";
export default function MyPage() {
const handleVote = (voteType: VoteType) => {
console.log(`User voted: ${voteType}`);
// Handle the vote
};
return (
<Review
headline="Great product, highly recommend!"
rating={4}
comments="This product exceeded my expectations."
date="May 5, 2025"
author="John Doe"
upVoteCount={12}
downVoteCount={2}
onVote={handleVote}
/>
);
}

Props

PropTypeRequiredDescription
headlinestringYesTitle of the review
ratingnumberYesRating value
commentsstringYesReview content
maxRatingnumberNoMaximum rating value (default: 5)
datestringNoDate of the review
authorstringNoName of the reviewer
onVotefunctionNoCallback for vote actions
upVoteCountnumberNoNumber of upvotes
downVoteCountnumberNoNumber of downvotes