shadcn.io is not affiliated with official shadcn/ui
Mega Help Index FAQ Block for React
A 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.
Installation
Overview
A mega help-index FAQ for React with Base UI. Under a compact header, a framed reading panel shows one answer, and below it four topic columns on shared hairlines list sixteen questions as buttons; the button for the open question is marked with an arrow that points up at the panel. The panel keeps the height of the longest answer, so choosing a question never moves the page. The columns go four across, two across, then one. It is built from Badge and Guides, with CSS for the entrance and your theme's tokens for every colour. For stores and help centres with many short answers where readers scan by topic.
FAQ
How do I change the topics and questions?
Edit TOPICS at the top of the file: each topic has an id, a title and four questions, each with an id, the question and its answer. The panel's stack of answers is built from the same data (ALL). Four columns of four fits the grid; fewer questions leave a column short, more make the columns uneven.
How does the answer panel work?
Every answer is stacked in one grid cell and only the chosen one is visible, so the panel is as tall as the longest answer and nothing shifts. The buttons carry aria-expanded (true for the open question) and aria-controls pointing at the panel, and a polite status line says which question is showing. Focus stays on the button you pressed.
What happens when I choose a question far below the panel?
The panel scrolls into view, but only if it is out of sight: the block calls scrollIntoView({ block: "nearest" }) on it, so on a desktop where both are visible nothing moves, and on a phone the answer comes to the top. It never moves focus.
Related
- Pro
Split View FAQ
NavigationA 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.
- Pro
Categorized FAQ
Topics and filtersA topic-tabbed FAQ for a bookkeeping app: a compact header, a band of line tabs with a count on each, and one accordion per topic.
- 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.
- Pro
Card Grid FAQ
Cards and gridsA static FAQ grid for a seed shop: six questions with their answers on show, in cells that share hairlines, each with an icon tile and a topic tag.
- Pro
Collapsible Groups FAQ
Accordion listsA grouped FAQ for a grocery-delivery service: four topic bands that collapse as a whole, each holding its questions as always-visible answers, the first two open.
- Pro
Expandable Cards FAQ
Cards and gridsAn FAQ of six separate cards for a candle subscription, each a collapsible with a topic tag and a round plus that fills in and becomes a minus; the open card lifts.