shadcn.io is not affiliated with official shadcn/ui
Weighted Category Ratings Reviews Block for Solid
Five criteria as ruled rows with a bar, a score and a signed change against the previous quarter, and a Select that weighs them for everyday, commuting or gym use and re-derives the overall score.
Installation
Overview
A category ratings block for Solid with Ark UI, for the Dunnockfield Vesper, a fictional pair of wireless headphones. A compact header has a Select at its end that weighs the five criteria for Everyday, Commuting or Gym listening; under it, a band with the overall score as a rolling figure beside read-only stars, the weights written out as text, and five ruled rows. Each row names a criterion, draws a bar from its score out of five with a tick where the previous quarter stood, and gives the score and the signed change against that quarter. Choosing a preset re-weights the overall score and every row's weight while the rows stay where they are, and a polite line says the result. Every score, change and overall is worked out from the twenty typed reviews at the top of the file. It's built from Select, Rating, Sliding Number and Guides.
FAQ
Where do the scores come from?
From the REVIEWS array: each review has a quarter and one score from 1 to 5 per criterion. A criterion's score is the average over the twelve reviews of the latest quarter, to one decimal; its change is that score minus the average of the eight reviews before it, so the sign always matches the numbers on screen. Add reviews and every figure follows.
How does the overall score get weighed?
Each preset in PRESETS gives a weight per criterion, and the weights add up to ten. The overall is the sum of each shown score times its weight, divided by ten, rounded to one decimal, so you can check it by hand from the rows. The weights are written under the score and in each row.
How does the Select differ between libraries?
The Select takes a list collection or its items directly, and a change handler that reads the chosen value.