shadcn.io is not affiliated with official shadcn/ui
Size Guide FAQ Block for React
A FAQ for an outdoor-clothing shop whose first answer is a size guide: a centimetres or inches switch and a table of body measurements, above five rows on delivery, returns and care.
Installation
Overview
A size-guide FAQ for React with Base UI. A centred header sits over rows that run from rail to rail, each opened by a chevron at its start. The first answer is open on load and holds a size guide: a one-line instruction, a switch between centimetres and inches, a table of body measurements (size, chest, waist, hip) that scrolls inside itself on a narrow screen, and a note on where to measure. Five more rows cover delivery, returns, exchanges, care and repairs, and a contact line closes the block. The rails and top rule come from the Guides spine, so the block lines up with its neighbours. It's built from Accordion, Segment Group, Table, Guides and Button, with CSS transitions for the entrance and your theme's tokens for every colour. For product pages where a wrong size is the main reason for a return.
FAQ
How do I change the sizes and measurements?
Edit MEASURES at the top of the file: each size has its chest, waist and hip in centimetres. The inches column is worked out from those numbers, rounded to the nearest half, so there's one list to keep right. Add a column by adding a field, a TableHead and a TableCell. The other questions are in QUESTIONS.
How does the unit switch work?
It's a Segment Group named "Unit" with centimetres and inches, and exactly one is always on. The line beside it ("Measurements in centimetres") is a polite live region, so a screen reader hears the change, and the table keeps its size, because only the numbers change. The choice isn't saved between visits.
How does the table behave on a phone and with a keyboard?
The table sits in a box that scrolls sideways when the screen is narrower than the table. With a keyboard, Tab focuses the box and the arrow keys scroll it; it's a named region ("Size guide"), so a screen reader announces it. Each size is a row header, so the reader says "M, chest 96".
Are the closed answers in the page's markup?
Yes. Closed answers stay in the markup as hidden="until-found", so search engines see them and the browser's find in page opens the one that holds a match.
Related
- Pro
Comparison FAQ
Steps and plansA tier-comparison FAQ for a form builder: column heads for Free, Pro and Enterprise over eight questions, each ending in three tick or dash marks and opening to the detail.
- Pro
Images FAQ
Code and mediaA photo-gallery FAQ whose open answers split into words and a framed greyscale drawing of the screen they describe: a share dialog, backup settings, an export menu, a search, an album picker and the trash.
- Pro
Docs Links FAQ
Reading and sharingA FAQ for a mapping service where every answer ends in two guides from the docs, as links with a reading time and an arrow.
- Pro
Accordion FAQ
Accordion listsA side-header FAQ for a web analytics tool: the title, one sentence and a contact prompt beside seven questions in an accordion, behind a split divider.
- Pro
FAQ with Contact Card
Contact and signupAn FAQ beside a contact card for an energy supplier: seven questions in an accordion, and behind a split divider a sticky card in card with email, live chat status, phone hours and a Shine Button.
- Pro
Procurement Pack FAQ
Calculators and toolsA FAQ for a data platform with a procurement pack beside the questions: three documents as checkboxes with a live count, an email field and one Shine Button that requests what is ticked.