App Hero
ProA hero for a mobile app: the headline, the rating line (stars, the average, how many rated and where) and the store buttons beside a phone on a disc of the app's colour.
What people who use the app say, as the stores show it: the average large with its stars and how many rated, a bar for each star count with its share written beside it, and a few reviews, each with its stars, its title, who wrote it, when and where. The bars grow in turn as the summary arrives. The stars are one element each (a star mask repeated five times, filled to the value), named by their value for a screen reader. Zero JavaScript.
Live, from the library itself, at full size: scroll, hover, navigate away and back. The demo is never gated.
Variants · each row writes the attribute the prop writes; the section's own CSS answers
JavaScript of its own
0 B
Uses Reveal and the shared runtime (1.9 kB raw, once per site). With those included: 3.0 kB raw.
CSS 11.2 kB raw including the base tokens. Measured from a production build, and again in CI for every change that can move it.
Browser support
Chrome 120 · Firefox 53 · Safari 15.4; needs mask-image. Elsewhere: without masks the stars are a filled bar; the numbers carry the rating.
The demo above is never gated; the source is. With a key in components.json (see account), the registry serves it like any other item:
npx shadcn@latest add @moonarc-pro/rating-summary---
import RatingSummary from '@/components/moonarc/pro/RatingSummary.astro';
---
<RatingSummary
headline="What people say"
average={4.8}
count="12,400"
source="on the App Store and Google Play"
bars={[86, 9, 3, 1, 1]}
reviews={[
{ stars: 5, title: 'Finally stuck', text: 'Forty days of reading, which has never happened before.', name: 'Mara L.', date: 'September 2026', source: 'App Store' },
{ stars: 4, text: 'Simple and calm. I would like a darker widget.', name: 'Tomás R.', date: 'August 2026', source: 'Google Play' },
]}
/>Without a key the registry answers 401 with an upgrade message. Everything this section composes is free: reveal.
| Prop | Type | Default | Description |
|---|---|---|---|
average | number | none | The average, 0 to 5, written with one decimal. |
count | string | none | How many rated, as written ("12,400"). |
bars | [number, number, number, number, number] | none | Five star first: counts or shares. Each bar is its share of the sum, written as a whole percentage, and drawn against the largest. |
reviews | { stars; title?; text; name; date?; source? }[] | none | The reviews, in order. date is words ("September 2026"); source is where it was left. |
source | string | none | Where the ratings were counted, after the count ("on the App Store and Google Play"). |
headline | string | none | The section's heading. Slot "headline" wins. |
eyebrow | string | none | A short line above the heading. |
copy | string | none | A line under the heading. |
level | 2 | 3 | 2 | Heading level of the heading. |
tone | 'surface' | 'muted' | 'ink' | 'brand' | unset (paints nothing) | The section's ground. |
density | 'compact' | 'cozy' | 'roomy' | 'cozy' | Block padding ×0.8 / ×1 / ×1.25 through --ma-density. |
The section reads the theme contract (shadcn's variable names with the base tokens as fallback), so a pasted theme or one --ma-brand recolours it. Its class names are the override surface and stay stable; a named slot replaces the matching prop with your own markup.
.ma-in.ma-rating.ma-rating__average.ma-rating__bars.ma-rating__big.ma-rating__body.ma-rating__by.ma-rating__copy.ma-rating__count.ma-rating__eyebrow.ma-rating__head.ma-rating__headline.ma-rating__inner.ma-rating__name.ma-rating__of.ma-rating__review.ma-rating__reviews.ma-rating__share.ma-rating__stars.ma-rating__summary.ma-rating__text.ma-rating__title.ma-rating__track
slot="headline"
The bars are drawn at their length at once.
ClientRouterCSS and Reveal.
Replaces: Review summary widgets embedded from review platforms · Hand-built star rating breakdowns. See the migration table.
A hero for a mobile app: the headline, the rating line (stars, the average, how many rated and where) and the store buttons beside a phone on a disc of the app's colour.
Shows big numbers that count up when scrolled into view, 120 ms apart, with labels and an optional bar under each, in a hairline row.
Shows two rows of testimonial cards drifting in opposite directions, pausing while hovered so any quote can be read.
Also: view transitions · how costs are measured · browser support · accessibility policy · five-minute setup · MCP for agents · this page as Markdown