Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Categorized FAQ Block for Ark UI

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.

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 categorized FAQ for React with Ark UI. Under a compact header, a band of line tabs names five topics, each with a small count of its questions; choosing a tab swaps in that topic's accordion of hairline rows, the first row open, and a contact line closes the block. The tab list scrolls sideways on a phone behind a fade at its end, and every panel shares one minimum height, so switching topics never moves the page below. The page's rails and top rule come from the Guides spine, and the tab band draws its own rule with + marks. It's built from Tabs, Accordion, Badge, Guides and Button, with CSS transitions for the entrance and your theme's tokens for every colour. For product pages and help centres whose questions fall into a handful of topics.

FAQ

How do I change the topics and questions?

Edit TOPICS at the top of the file: each topic has an id, a label and its questions (an id, the question and its answer, one to three sentences). The count on each tab is the length of that list, so it never drifts, and the first question of every topic opens when its tab does. Keep it to about five topics and four questions each: more than that wants a search.

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

The tabs are a real tab list named "FAQ topics": the arrow keys move between them (mirrored in a right-to-left layout), Home and End jump to the first and last, and Tab moves on into the open panel. Each question is a button inside its own h3 under the section's h2, and Enter or Space opens it. Inside a panel the Up and Down arrows also move between questions.

Are the answers of the other topics in the page's markup?

Yes, the panels of the topics you aren't looking at stay in the page, hidden. The Tabs take lazyMount={false} and unmountOnExit={false}, and the Accordions the same two props, so every answer renders from the start.

Why doesn't the page move when I switch tabs?

Every panel has the same minimum height, about the tallest topic with its first answer open, so a shorter topic leaves quiet space under its rows instead of pulling the contact line up. Opening more answers in a panel still grows it, as any accordion does.

How does it fit on a phone?

The tab list becomes a row you scroll sideways, with a fade at its end to say there's more, and the focused tab scrolls into view. The rows run from rail to rail, long questions wrap beside their chevron, and nothing scrolls the page sideways at 320 pixels.