shadcn.io is not affiliated with official shadcn/ui
Tabbed Sections Reviews Block for Ark UI
Eighteen reviews of a sewing machine sorted into four tabs, Most recent, Most helpful, Critical and Verified, each with its derived count and three reviews.
Installation
Overview
Tabbed review sections for React with Ark UI, for Bobbinmill, a fictional sewing machine. A centred header gives the count and the average (worked out from the eighteen typed reviews), and a band of line tabs under a rule with + marks offers four groups: Most recent, Most helpful, Critical (one and two stars) and Verified purchases. Each tab carries its count, derived from the reviews, and its panel opens with a line saying which three it shows ("3 of the 4 reviews rated 1 or 2 stars, newest first") above three ruled review rows with the reviewer, the stars, the title and the text. Every panel is drawn once more, unseen, in the same cell, so switching tabs never moves the page. On a phone the tab list scrolls sideways. It's built from Tabs, Badge, Rating, Avatar and Guides.
FAQ
How do I change the tabs?
Each group is a typed list at the top of the file: RECENT, HELPFUL, CRITICAL and VERIFIED are built from REVIEWS with a sort or a filter, and TABS gives each a label, a count, a note and the three rows shown (SHOWN). Add a tab by adding an entry to TABS; the trigger, the count and the panel come from it. The "With photos" tab of other review lists is left out, since no review here carries a photo.
Where do the counts come from?
From the length of each group: all 18 reviews for the first two tabs, the reviews rated 1 or 2 stars for Critical, and the verified purchases for the last. Tab names include the count for screen readers ("Critical 4 reviews").
Why doesn't the page move when I switch tabs?
All four panels are drawn together, unseen, in the same grid cell, and the live panel sits on top of them, so the cell keeps the height of the tallest panel. The unseen copies are hidden from assistive technology and the keyboard.