shadcn.io is not affiliated with official shadcn/ui
Questions By Audience About Block for React
A questions section for a handbook company, with three audiences in a vertical tab list and the open audience as a definition list whose answers stay visible.
Installation
Overview
A questions-by-audience section for React with Base UI, written for Askwell, a fictional company handbook. The heading and a vertical tab list of three audiences sit at the start. The open audience is a definition list at the end, behind a divider: the question, then a bold short answer and the rest of it, all of it visible. Nothing in the open list collapses. An unseen copy of every list holds the panel at the tallest, so switching audience never moves the page. On a phone the audiences become a row of chips that scrolls. It's built from Tabs and Guides, with CSS for the entrance and your theme's tokens for every colour. For an about page that answers investors, customers and candidates without an accordion. The questions and the answers are example data.
FAQ
How do I change the questions?
Edit AUDIENCES at the top of the file. Each audience has an id, a label for the tab, a title for the panel, and answers. An answer has a question, a short lead and a detail. The first audience starts open. Add a question or an audience and the list, the panel and the height of the block follow the array.
How do the tabs work with a keyboard?
The list stays a vertical tab list, including on a phone where it looks like a row of chips, so Up and Down move between the audiences, Home and End jump to the first and last, and Tab moves into the open list. The open row is the selected tab, marked by a bar on a large screen and a filled chip on a phone.
Are the answers collapsed?
The open audience's answers are a definition list, each one a bold short answer and then the rest, and none of them folds away. Choosing another audience shows that audience's list. The other lists are not mounted in the tab panel.
Why doesn't the page move when I switch audience?
The lists differ in length. An unseen, inert copy of every list sits in the same grid cell as the open one, so the cell keeps the height of the tallest. Those copies are out of the accessibility tree and the tab order, and they are not a second set of answers to read.
Related
- Pro
Situation Tabs Operating Principles
Principles and processAn operating-principles section for an accounting-automation company: line tabs by situation, and under them the open situation's three rules as hairline rows, each with the question we ask.
- Pro
Vertical Tabs Lessons Learned
TimelinesA lessons-learned section for a retrospectives tool: a vertical tab list of six post-mortems with the year each happened, and the open one as what happened, what we learned and what changed.
- Pro
Scenario Picker Ethical Practices About
Principles and processAn ethics block for a survey tool: three requests as radio cards (hand over customer data, switch off a feature, share usage with an investor), each answered in three numbered steps and a named decider.
- Pro
Vertical Tabs Data Privacy About
Security and platformA data-flow explainer for a backup service: vertical tabs for what we collect, where it lives and your rights, each panel a four-column table, with a ghost link to request your data.
- Pro
Domain Tabs Security Practices About
Security and platformSecurity practices for a password manager in four domain tabs, each a list of controls marked Done or Rolling out, under a security score worked out from the controls.
- Pro
Pull Quotes and Press Kit About
Press and recognitionA press page for a ticketing company: three pull quotes set as headlines with the outlet in serif lettering, and a press kit of three real files that download from the page, a boilerplate with a Copy button and a press contact.