FAQ, list


Install
npx shadcn add @klarhimmel/faq-listDetailsAbout, usage, props and more
A heading with a ruled list of questions that open to show the answer: beside the list, stacked above it, or stacked and centred over a narrower list.
Import
Import
- faq/accordion
- Category
- The questions people ask before they buy. New project? Set it up once: /get-started/installation.
Notes
When to use it
The default FAQ: heading on the left, an accordion of up to ten questions on the right, with hairline dividers. Pick faq-centered when you have only a few questions and want a softer look, or faq-support when a human contact should sit beside them.
Writing for it
- The left column carries the eyebrow, title and description (300), so use the description to say who answers if the list falls short. - A question holds 140 characters; keep each to one line so the plus icon on the right stays aligned with the text. - With a minimum of one item and a ceiling of ten, you can start with a single entry, but a lone accordion row reads as a mistake. Start from three.
Watch out for
Answers are native details elements, so they are closed until clicked and search-in-page may not find text inside them in every browser. Anything a buyer must see before paying belongs in the page copy, not only here.
Pairs well with
Usage
The block in a page, with its default content (long lists shortened). Every prop is in the table below.
Props
The type, default and text limit of every prop. On a real page, over-limit text is kept and checkSections flags it (Installation, Check a page before you ship); this live preview shows the default until it fits. The panel above edits all props.
| Prop | Type | Default | Description |
|---|---|---|---|
eyebrow | string | 'Section' | Text, up to 60 characters. |
title | string | 'Say what the answers cover' | Text, up to 120 characters. |
description | string | 'Say in one sentence what to do if t…' | Text, up to 300 characters. |
items | { question, answer }[] | 5 items | List of 1 to 10. Each item: question, answer. |
layout | 'beside' | 'stacked' | 'center' | - | One of 'beside', 'stacked', 'center'. Optional; empty is not rendered. |
headingSize | 'title' | 'heading' | - | One of 'title', 'heading'. Optional; empty is not rendered. |
openFirst | boolean | - | Optional; empty is not rendered. |
primaryAction | Link | - | Optional; empty is not rendered. |
secondaryAction | Link | - | Optional; empty is not rendered. |
headingLevel | '1' | '2' | - | One of '1', '2'. Optional; empty is not rendered. |