shadcn.io is not affiliated with official shadcn/ui
Rating and Laurels Trust Bar Awards Block for React
One trust line: a read-only rating with its score and review count, three small laurels with their awards, and a ghost link to all the recognition.
Installation
Overview
A trust bar for React with Base UI, joining a rating and recognition on one line. Under the page's top rule, a read-only star rating in the foreground tone sits beside its score in words ("4.8 out of 5") with the review count under it ("from 2,310 reviews on 4 sites"), a hairline divider follows, then three small drawn laurels each with an award and the programme and year that gave it, a second divider and a ghost link, "See all recognition". The count is summed from four typed review sources and the score is their weighted average, so the figures always agree. On a phone the parts stack, the rating first. It is built from Rating, Button and Guides. The awards and programmes are made up for the example: swap AWARDS for your own, and use only recognition you have actually received. The four review sites are not named: only their counts and ratings are typed.
FAQ
Where do the score and the count come from?
From SOURCES, an array of four review sites with a count and a rating. The count is their sum, the score their average weighted by count and rounded to one decimal, and the stars are drawn to the nearest half. Change the array and every figure follows.
Can a visitor change the rating?
No. The stars are a read-only drawing hidden from assistive technology and taken out of the tab order; the words beside them say the score.
Where does the link go?
To #: point it at your recognition page. It is a ghost button with an arrow that turns around in a right-to-left page.
The button renders the link it's given with render, with nativeButton={false}.
Are the awards real?
No. The programmes are invented for the example. Each laurel is a drawing hidden from assistive technology, and the award, programme and year are text.
Related
- Pro
Compact Badge Strip Awards
Strips and bannersA framed awards bar for tight spaces: a bold lead, four outline badges with a small drawn laurel or medal, the award and the year, and a counted tally.
- Pro
Seal Row Awards
Badges and sealsA free row of six drawn award seals, each a different silhouette, with the award, its programme and the year under it, and one counted line below.
- Pro
Trust Badges Testimonials
Ratings and reviewsA scoreboard of four review sources for a bookkeeping app: a weighted average beside the heading, then a band of four cells on shared hairlines, each with a score, partly filled stars, its review count, one reviewer line and a link.
- 4.8Pro
Top Bar Rating Banner
Store barsA centred rating strip: five stars drawn filled to 4.8, the score with its review count, and a link to leave a review.
- Pro
Issuer Ledger Awards
Badges and sealsSix cells for the programmes that gave an award, each a drawn monogram mark with the programme as a wordmark and a tally of awards and the year since.
- Pro
Announcement Bar Awards
Strips and bannersA slim announcement bar for one headline award: a drawn laurel, one sentence naming the award and the programme, and a Read the story link.