shadcn.io is not affiliated with official shadcn/ui
Accordion Detailed Breakdown Reviews Block for Solid
Four areas of an e-bike as accordion rows from rail to rail, each with a bar, a score and a signed change against the previous quarter, opening into three scored parts, under a sentence that names the strongest and the weakest.
Installation
Overview
A detailed breakdown for Solid with Ark UI, for the Plinthgate, a fictional e-bike. A start-aligned header carries a derived sentence ("Strongest: Ride 4.7. Weakest: Service 3.8."), then one accordion whose four rows run from rail to rail under a rule with a plus mark at each end. A row's trigger shows an area's name, a bar from its score out of five, the score and the signed change against the previous quarter; open it and its three parts show the same way. The first area is open on load and any number of rows may stay open. Every score, change and the verdict is worked out from the fourteen typed reviews at the top of the file, each of which scores all twelve parts. It's built from Accordion and Guides.
FAQ
How are the scores worked out?
Each review in REVIEWS has a quarter and twelve scores from 1 to 5, three for each area in order. A part's score is its average over the eight reviews of the latest quarter; an area's score is the average of all its parts' scores in those reviews, to one decimal; its change is that minus the same figure for the six reviews before. The verdict sentence picks the highest and the lowest area from the same numbers.
Can more than one row be open?
Yes: the rows are independent, and the first starts open so a visitor sees what a panel holds. Arrow keys move between the triggers.
The Accordion takes multiple, a defaultValue list and value on each item.
How is the change shown without colour?
By an arrow, a sign and a word: up arrow and plus, down arrow and a true minus, or a dash and no sign when it did not move. A screen reader hears "up 0.2 on Q2" or "down 0.2 on Q2". The Service row is the one that falls, which is also why it is the weakest.