Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Tabbed Vertical FAQ Block for Svelte

A vertical-tabs FAQ for a transit app: a rail of five topics with an icon and a count each, beside the open topic's accordion, 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 vertical-tabs FAQ for Svelte with Ark UI. Under a compact header, a rail at the start lists five topics, each with an icon, its name and a count of its questions; the open topic's accordion fills the end, behind a split divider that runs from the top rule to the block's end, and a contact prompt sits at the rail's foot. Below lg the rail becomes a row of tabs that scrolls sideways, the arrow keys switch from Up and Down to Start and End to match, and the panels share one minimum height so choosing a topic never moves the page. It's built from Tabs, Accordion, Badge, Guides and Button, with your theme's tokens for every colour. For help centres and product FAQs with four to six topics of three or four questions each.

FAQ

How do I change the topics?

Edit TOPICS at the top of the file: each topic has an id, an icon (any lucide icon), a label and its questions. The count beside each name is the length of that list. The first question of every topic opens when its tab is chosen; change defaultValue on the accordion to open another, or to none.

How does the keyboard work, in the rail and on a phone?

In the rail the tabs are a vertical tab list: Up and Down move between topics, Home and End jump to the first and last, and Tab moves into the open panel. Below lg the same list is horizontal, so the Start and End arrows (mirrored in a right-to-left layout) take over. The block reads the screen width in an effect and tells the tab list which way it runs, so the keys always match what you see.

Is there a flash on a phone when the page loads?

The server renders the rail, because the orientation is read from the screen only in the browser; on a phone the list turns horizontal as soon as the page hydrates, a moment after first paint. The two lists share one set of tabs and panels, so no state is lost and the layout settles in one step.

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

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

What does the open row's box do?

Each question ends in a small boxed chevron that turns over while its answer is open. Under reduced motion it flips without turning. It is a decoration; the button's expanded state is what a screen reader hears.