mozilla / protocol

A design system for Mozilla websites.
https://protocol.mozilla.org/
Mozilla Public License 2.0
260 stars 77 forks source link

Component: star rating #919

Open craigcook opened 8 months ago

craigcook commented 8 months ago

We should consider making a component for displaying an aggregate product rating from one to five stars, as well as allowing users to click and register their own rating. These likely need to be separate components: one for display-only and another for user rating.

For display, we could optionally show the total number of reviews alongside the stars, to indicate the basis for that aggregate score (for displaying aggregate scores we probably need to support half-stars but could force users to choose 1-5).

An expanded component might also include a breakdown chart showing how many people rated at each point.

Examples from addons.mozilla.org: image image

Examples from Amazon: image image

The most immediate use case for this component is addons.mozilla.org but it's a common enough pattern on the web we should considering making it widely available in Protocol.

reemhamz commented 8 months ago

This would be a good component to get Jessica's opinion on for the next Protocol meeting