Skip to content
Klarhimmel UI

FAQ, numbered cards

FAQ, numbered cards previewFAQ, numbered cards preview

Install

npx shadcn add https://ui.klarhimmel.com/r/faq-numbered-cards.json
DetailsAbout, usage, props and more

A left-aligned header over a hairline, then every question and answer open in its own numbered, bordered card, three to a row on wide containers and one on a phone, and…

Import

Import

import Block from '@/components/klarhimmel/blocks/faq-numbered-cards';
Also called
  • faq/numbered-cards
About
A left-aligned header over a hairline, then every question and answer open in its own numbered, bordered card, three to a row on wide containers and one on a phone, and an action row under a second hairline.
Category
The questions people ask before they buy. New project? Set it up once: /get-started/installation.

Notes

When to use it

A left-aligned header over a hairline, then every question and answer open in its own numbered bordered card, with an action row under a second hairline. Use faq-list for answers that open on click.

Writing for it

- Write each answer as a short paragraph, since all of them are visible at once. - Let the numbers 01, 02 and so on carry the order, and put the most asked question first. - Use the action row for what to do if the answer is not here, and say how soon someone replies.

Watch out for

The cards sit three to a row on wide containers and one on a phone. With all three action labels empty the row and its rule go, which is right when nothing follows.

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 FaqNumberedCards from '@/components/klarhimmel/blocks/faq-numbered-cards';

export default function Section() {
  return (
    <Theme theme="brand">
      <BlockSurface>
        <FaqNumberedCards props={{
          "eyebrow": "Section name",
          "title": "Say what the answers cover",
          "description": "Say what to do if the answer is not here, and how soon someone 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 next."
            },
            {
              "question": "Ask a question a customer would ask",
              "answer": "Answer in one or two plain sentences, with the key fact first, then what to do next."
            },
            {
              "question": "Ask a question a customer would ask",
              "answer": "Answer in one or two plain sentences, with the key fact first, then what to do next."
            }
          ],
          "primary": {
            "label": "Main action",
            "href": "/signup"
          },
          "secondary": {
            "label": "Second action",
            "href": "/contact"
          },
          "more": {
            "label": "Read more",
            "href": "/help"
          }
        }} />
      </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 to do if the answer is not…'Text, up to 300 characters.
items{ question, answer }[]6 itemsList of 2 to 9. Each item: question, answer.
primaryLink{…}Optional; empty is not rendered.
secondaryLink{…}Optional; empty is not rendered.
moreLink{…}Optional; empty is not rendered.
compactboolean-Optional; empty is not rendered.
headingLevel'1' | '2'-One of '1', '2'. Optional; empty is not rendered.