Skip to content
Klarhimmel UI

FAQ, list

FAQ, list previewFAQ, list preview

Install

npx shadcn add @klarhimmel/faq-list
DetailsAbout, 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

import Block from '@/components/klarhimmel/blocks/faq-list';
Also called
  • 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.

Usage

The block in a page, with its default content (long lists shortened). Every prop is in the table below.

section.tsx
import { Theme } from '@/components/klarhimmel/theme/style';
import { BlockSurface } from '@/components/klarhimmel/blocks/surface';
import FaqList from '@/components/klarhimmel/blocks/faq-list';

export default function Section() {
  return (
    <Theme theme="brand">
      <BlockSurface>
        <FaqList props={{
          "eyebrow": "Section",
          "title": "Say what the answers cover",
          "description": "Say in one sentence what to do if the answer is not here, and who replies.",
          "items": [
            {
              "question": "Ask a question customers have",
              "answer": "Answer in one or two plain sentences, with the key fact first, then what to do or where to go next."
            },
            {
              "question": "Ask a question customers have",
              "answer": "Answer in one or two plain sentences, with the key fact first, then what to do or where to go next."
            },
            {
              "question": "Ask a question customers have",
              "answer": "Answer in one or two plain sentences, with the key fact first, then what to do or where to go next."
            },
            {
              "question": "Ask a question customers have",
              "answer": "Answer in one or two plain sentences, with the key fact first, then what to do or where to go next."
            },
            {
              "question": "Ask a question a customer would ask before deciding",
              "answer": "Answer in one or two plain sentences, with the key fact first, then what to do or where to go next."
            }
          ]
        }} />
      </BlockSurface>
    </Theme>
  );
}

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.

PropTypeDefaultDescription
eyebrowstring'Section'Text, up to 60 characters.
titlestring'Say what the answers cover'Text, up to 120 characters.
descriptionstring'Say in one sentence what to do if t…'Text, up to 300 characters.
items{ question, answer }[]5 itemsList 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.
openFirstboolean-Optional; empty is not rendered.
primaryActionLink-Optional; empty is not rendered.
secondaryActionLink-Optional; empty is not rendered.
headingLevel'1' | '2'-One of '1', '2'. Optional; empty is not rendered.