RatingSummary

The average, the spread, and a way into the reviews. The score counts up, bars fill row by row, and rows can filter to a star level. Data.

Open playground
0
Based on 8 reviews
54
43
31
20
10

About

RatingSummary is a React component in the Data category of smoui. It is typed, ships no stylesheet, follows your theme through CSS variables, and honors prefers-reduced-motion. Import it with import { RatingSummary } from "@ashutoshswamy/smoui" and set ratings.

Install

Terminal
npm i @ashutoshswamy/smoui

Usage

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

<RatingSummary ratings={reviews.map(review => review.rating)} />

Props 1

ratings

Individual scores from one to five.

number[]