Skip to content
shadcn.io

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.

Framework
UI library

Preview

Preview width

Installation

Part of Pro
Pro unlocks the code and one-line install of every Pro button and text effect, plus the MCP for your AI editor.
Have Pro already? Sign in to open it.Opens here as soon as you're Pro.

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.

How does it work with a keyboard and a screen reader?

The topic names are h3 headings and the questions are buttons in real lists, so Tab visits them in reading order and Enter or Space chooses one. There are no arrow-key shortcuts between columns.

How does it fit on a phone?

The panel stays first, then the topics stack one column per row below sm and two across from sm, four across from lg. Questions wrap to a second line when they must, and nothing scrolls sideways at 320 pixels.

  • Pro

    Split View FAQ

    Navigation

    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.

  • Pro

    Categorized FAQ

    Topics and filters

    A 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

    Navigation

    A 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 grids

    A 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 lists

    A 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 grids

    An 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.