Skip to content
Klarhimmel UI

FAQ, question and answer rows

FAQ, question and answer rows previewFAQ, question and answer rows preview

Install

npx shadcn add @klarhimmel/faq-rows
DetailsAbout, usage, props and more

Every answer open, set as a table of rows: the question is a heading on the left, the answer beside it on the right, hairlines between.

Import

Import

import Block from '@/components/klarhimmel/blocks/faq-rows';
Also called
  • faq/rows
About
Every answer open, set as a table of rows: the question is a heading on the left, the answer beside it on the right, hairlines between. Nothing to click, so it prints and scans well; stacks on narrow containers.
Category
The questions people ask before they buy. New project? Set it up once: /get-started/installation.

Notes

When to use it

A policy-style table where every answer is open: the question as a heading on the left, the answer beside it. Nothing to click, so it prints and scans well. For lighter, openable cards use faq-centered.

Writing for it

- Questions are headings in a one-third column and hold 120 characters, so phrase them as short noun phrases or plain questions such as 'Do you have parking?'. - Answers get 500 characters and span the wider two-thirds. Put concrete times, prices and conditions there, since the reader sees them without any click. - The default title shows the register: 'The practical details, in plain words'. A title (120) that promises facts fits this layout better than 'FAQ'.

Watch out for

An empty answer is allowed by the schema (only the question is required) and then the right cell is simply blank, leaving a heading with nothing beside it. Check every row after editing.

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 FaqRows from '@/components/klarhimmel/blocks/faq-rows';

export default function Section() {
  return (
    <Theme theme="brand">
      <BlockSurface>
        <FaqRows props={{
          "eyebrow": "Section name",
          "title": "Say what the answers cover",
          "description": "Say what you promise and what you ask.",
          "items": [
            {
              "question": "Ask a common question",
              "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 common question",
              "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 name'Text, up to 60 characters.
titlestring'Say what the answers cover'Text, up to 120 characters.
descriptionstring'Say what you promise and what you a…'Text, up to 300 characters.
items{ question, answer }[]5 itemsList of 2 to 8. Each item: question, answer.
headingLevel'1' | '2'-One of '1', '2'. Optional; empty is not rendered.