shadcn.io is not affiliated with official shadcn/ui
Split View FAQ Block for React
A master-detail FAQ for a sales CRM: a list of eight questions at the start and the chosen answer in a framed panel at the end, with a Next question button.
Installation
Overview
A split-view FAQ for React with Base UI. A header sits over two parts behind a split divider: a list of eight questions at the start, and the chosen question's topic, answer and a Next question button in a framed panel at the end. The list is a Listbox, so the arrow keys move the selection and the panel follows at once. The panel keeps the height of the longest answer, so nothing moves when the selection changes. On a phone a select replaces the list and drives the same panel. It is built from Listbox, Native Select, Badge, Button and Guides, with your theme's tokens for every colour. For product FAQs where readers scan the questions first and read one answer at a time.
FAQ
How do I change the questions?
Edit QUESTIONS at the top of the file: each entry has an id, a topic (shown as a badge above the answer), the question and its answer, one to three sentences. The list, the select, the panel and the "Question 4 of 8" count are all built from it. Keep it to about eight: past that, the list outgrows the panel and categories serve readers better.
How does it work with a keyboard and a screen reader?
Tab moves into the list, which is a listbox with one tab stop. Up and Down move the selection and the answer follows; Home and End jump to the first and last question. The Next question button goes to the following question and wraps to the first after the last. Focus never moves on its own: when the selection changes, a polite status line announces "Question 4 of 8" with the question. Hover alone doesn't select, only a click or the keys do.
Does the panel change height when the question changes?
No. Every answer is stacked in one grid cell and only the selected one is visible, so the panel is as tall as the longest answer. The hidden answers are in the markup but out of the accessibility tree.
Why is there an Ark UI import on every base?
The catalog's Listbox is built on Ark UI on all four React bases, so the block imports createListCollection from @ark-ui/react/collection to describe the items, on Base UI, Radix and React Aria too. The Vue, Svelte and Solid versions use the matching Ark package.
Related
- Pro
Tabbed Vertical FAQ
NavigationA vertical-tabs FAQ for a transit app: a rail of five topics with an icon and a count each, beside the open topic's accordion, behind a split divider.
- Pro
Collapsible Sidebar FAQ
NavigationA sidebar FAQ for a holiday-rental site: a topic rail with two collapsible groups and a live count, beside a filtered list, and a native select on phones.
- Pro
Keyboard Navigation FAQ
SearchA keyboard-first FAQ for a text editor: eight questions that move with the arrow keys, Home and End, beside a framed legend of the keys that lights the one you press.
- Pro
Mega Help Index FAQ
Cards and gridsA help-index FAQ for a DIY store: sixteen questions in four topic columns on shared hairlines, with the chosen answer in a framed reading panel above them.
- 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
Breadcrumb FAQ
NavigationA drill-down help centre for a mobile carrier: four topic cells in a framed card, a breadcrumb bar, and each topic's questions behind a click.