Review

A review you can read quickly. Long ones fold to three lines and unfold in place; Helpful counts up as you press it. Cards.

Open playground
Sample reviewerSample date

Example review

Replace this sample with a real product review. Long reviews fold to three lines and unfold in place, so a page of them stays easy to scan. This one is long enough to show it.

About

Review is a React component in the Cards category of smoui. It is typed, ships no stylesheet, follows your theme through CSS variables, and honors prefers-reduced-motion. Import it with import { Review } from "@ashutoshswamy/smoui" and set verified, helpful, author among its 5 props.

Install

Terminal
npm i @ashutoshswamy/smoui

Usage

TSX
import { Review } from "@ashutoshswamy/smoui";

<Review author="Reviewer name" rating={4.5} title="Review title" body="Review text" />

Props 5

verified

Marks a confirmed purchase.

boolean
helpful / onHelpful

Adds a Helpful button that counts up.

number / (on) => void
author / body

Reviewer and review text.

string
rating

Score from zero to five, including halves.

number
title / date / avatar

Optional headline, date label, and photo URL.

string