Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

FAQ with Call to Action Block for React

An FAQ whose answers end in the next step, for a clinic scheduling tool: six accordion rows, each open answer closing with a button that fits it, the first one a Shine Button.

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

An FAQ with a call to action in every answer for React with Base UI. A start-aligned header sits over six accordion rows that run from rail to rail under a rule with + marks, each with a ringed chevron at its end that fills in while the row is open. The open answer ends with the action that fits it: preview the booking page, read the rota guide, see the reminder options, download the security policy, start a free import, compare plans. The first answer's button is the block's one Shine Button and the others are outline buttons, so only one thing in the block asks for attention at a time. It's built from Accordion, Guides, Shine Button and Button, with CSS transitions for the entrance and your theme's tokens for every colour. For product and pricing pages where a question is the moment a visitor is ready for the next step.

FAQ

How do I change the actions?

Edit QUESTIONS at the top of the file: each entry has an id, the question, its answer, the label of the button in action and a primary flag. The button always reads action; its link is url, "#" until you set it, so give each question its own address there. Exactly one entry should have primary: true: that's the Shine Button, and the rest are outline buttons.

Why is only one button a Shine Button?

Because the first screen should have a single main action. The question that's open on load holds the Shine Button, so the button shows without a click; opening another question shows an outline button. If you open a different question on load, give it the primary flag instead.

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 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. Enter or Space opens and closes it, and the button says whether it's expanded. A closed answer's button can't be reached with Tab, so Tab moves from question to question, and into an open answer's button only while it's open. Tab alone moves between questions on this library: its accordion doesn't take arrow keys.

What moves, and what happens with reduced motion?

The header and rows fade up once on load, an answer eases open under its question, and the chevron turns over while it fills in. With reduced motion the entrances are off and the chevron swaps without turning. The answers also open and close at once, with no height animation.

  • 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

    Docs Links FAQ

    Reading and sharing

    A FAQ for a mapping service where every answer ends in two guides from the docs, as links with a reading time and an arrow.

  • Pro

    Related Questions FAQ

    Reading and sharing

    A cross-linked FAQ for a password manager: every answer ends in two related questions, and choosing one opens that row, scrolls to it and moves focus to its question.

  • 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

    A call to action between solid rails that follows the page theme, in a card in card with a two-step email capture: an email field and a Shine Button, then a six-digit code that verifies on the sixth digit and turns into a confirmation in the same space.

  • Pro

    Chatbot-Style FAQ

    Contact and signup

    An FAQ you ask like a chat, for a local council: a chat window with six question chips that posts your choice, shows a typing indicator and replies with the FAQ's own answer.