Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Dual Column Accordion FAQ Block for React

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.

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 accordion FAQ for React with Base UI. A start-aligned title and sentence, with a ghost link to the class dates at their end, sit above a band that holds two separate accordions, four questions each, behind a split divider that meets the band's rule with a + mark. Each list is its own accordion, so opening a question in one never moves the other, and each column grows from its top. Hairline rows divide the questions and a chevron turns over on the open one. On a phone the first list is followed by the second, with a ruled break between them. The page's rails and top rule come from the Guides spine, so the block lines up with its neighbours in a stack. It's built from Accordion, Guides and Button, with CSS transitions for the entrance and your theme's tokens for every colour. For product pages and help pages where eight questions fall into two natural groups.

FAQ

How do I change the questions?

Edit CLASSES and STUDIO at the top of the file: each entry is an id, the question and its answer, one to three sentences. OPEN_CLASSES and OPEN_STUDIO name the question open in each list on load; set one to an id that doesn't exist to start with that list closed. Keep each list to about four: past that, a column gets long next to its neighbour. Each list opens one answer at a time. Add multiple to the Accordion to let several stay open.

Are the closed answers in the page's markup?

Yes. Each Accordion takes hiddenUntilFound, so every closed answer stays in the markup as hidden="until-found": search engines see all 8, and the browser's find in page opens the answer 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, so a screen reader's headings list shows every question. Tab moves from question to question, Enter or Space opens and closes one, and the button says whether it's expanded. The open answer is labelled by its question. Tab then continues into the second list.

What moves, and what happens with reduced motion?

The header and the band fade up once when the page loads, with CSS transitions, and a chevron turns over as an answer opens. With reduced motion the entrances are off. The answers also open and close at once, with no height animation.

How does it fit on a phone?

Below the lg breakpoint the two lists stack, with a rule and + marks between them where the divider was, and the rows run from rail to rail. A question that doesn't fit wraps to a second line with its chevron beside the first, and nothing scrolls sideways at 320 pixels.

  • 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

    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

    Numbered FAQ

    Accordion lists

    A numbered FAQ for a wine club: eight accordion rows from rail to rail, with a margin of tabular numerals, 01 to 08, behind a hairline; the open row's numeral turns to full strength.

  • 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

    Pricing With FAQ

    Proof and guarantees

    Plans answered by the pricing FAQ for an e-commerce builder: a compact plan list, a row each with its name, price and call to action, beside an accordion of six questions with the first one open, in one ruled band.

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