Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Two Column FAQ Block for React

A reading-layout FAQ for a bakery-supplies wholesaler: the title, a sentence and a contact link stay in view at the start while ten questions scroll past in an accordion at the end.

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 two-column FAQ for React with Base UI. A start column holds the title, one sentence and a contact link and stays in view while the end column, behind a split divider, scrolls through ten questions in an accordion, one answer open at a time. The rows are hairlines with a chevron, with no band or marks of their own, so the list reads as plain text. On a phone the header stacks above the list and stops sticking. It is built from Accordion, Button and Guides, with CSS for the entrance and your theme's tokens for every colour. For wholesale, onboarding and policy pages with a long list of questions.

FAQ

How do I change the questions?

Edit QUESTIONS at the top of the file: each entry is an id, the question and its answer, one to three sentences. OPEN_QUESTION names the one that is open on load; set it to an id that doesn't exist to start with all of them closed. Ten is a comfortable length for the sticky header to earn its place; for fewer than six, the model FAQ with a side header does the same job.

How does the header stay in view?

Its inner box is lg:sticky lg:top-16, inside a grid cell as tall as the list, so it sticks while the list scrolls and stops at the list's end. Change top-16 to clear your site's header. Sticky stops working if any ancestor adds overflow: hidden, auto or scroll, so keep the block out of a scrolling wrapper (the section's overflow-x-clip is fine). Below lg it is plain and scrolls away.

Are the closed answers in the page's markup?

Yes. The Accordion takes hiddenUntilFound, so every closed answer stays in the markup as hidden="until-found", and the browser's find in page opens the one that holds a match.

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

Each question is a button inside its own h3 under the section's h2. Enter or Space opens and closes it, and the button says whether it's expanded. Tab moves from question to question; there are no arrow-key shortcuts between rows on this base.

  • Pro

    Accordion FAQ

    Accordion lists

    A 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 Accordion Hero

    Interactive demos

    A compact hero on ruled bands between solid rails: a headline and a Shine Button, then a band with four common questions in an accordion that opens one at a time, beside a short note.

  • Pro

    A two-column FAQ for a pottery studio: a start-aligned header, then two independent accordions of four questions side by side, behind a split divider.

  • Pro

    Compact FAQ

    Accordion lists

    A dense FAQ for ski-lift passes: ten tight accordion rows with small type and one-sentence answers in a narrow framed list, a chevron at the start of each row.

  • Pro

    FAQ with Contact Card

    Contact and signup

    An 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

    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.