FAQ

Frequently asked questions on the kit's Accordion, stacked under the heading or split beside it, here split.

Your headline goes here

A short line about the questions goes here.

import { Faq, type FaqItem } from "@produkto/ui/Faq";

const items: FaqItem[] = [
  {
    question: "Question 1 goes here?",
    answer: "The answer to question 1 goes here, in a sentence or two.",
  },
  {
    question: "Question 2 goes here?",
    answer: "The answer to question 2 goes here, in a sentence or two.",
  },
  {
    question: "Question 3 goes here?",
    answer: "The answer to question 3 goes here, in a sentence or two.",
  },
  {
    question: "Question 4 goes here?",
    answer: "The answer to question 4 goes here, in a sentence or two.",
  },
  {
    question: "Question 5 goes here?",
    answer: "The answer to question 5 goes here, in a sentence or two.",
  },
];

const Example = () => (
  <Faq
    description="A short line about the questions goes here."
    items={items}
    layout="split"
    title="Your headline goes here"
  />
);

export default Example;

Usage

import { Faq, type FaqItem } from "@produkto/ui/Faq";
const items: FaqItem[] = [
  {
    question: "Question 1 goes here?",
    answer: "The answer to question 1 goes here, in a sentence or two.",
  },
  {
    question: "Question 2 goes here?",
    answer: "The answer to question 2 goes here, in a sentence or two.",
  },
];

<Faq
  eyebrow="FAQ"
  title="Your headline goes here"
  description="A short line about the questions goes here."
  items={items}
/>

Examples

Split

layout="split" sets the heading beside the questions on large screens.

FAQ

Your headline goes here

A short line about the questions goes here.

import { Faq, type FaqItem } from "@produkto/ui/Faq";

const items: FaqItem[] = [
  {
    question: "Question 1 goes here?",
    answer: "The answer to question 1 goes here, in a sentence or two.",
  },
  {
    question: "Question 2 goes here?",
    answer: "The answer to question 2 goes here, in a sentence or two.",
  },
  {
    question: "Question 3 goes here?",
    answer: "The answer to question 3 goes here, in a sentence or two.",
  },
  {
    question: "Question 4 goes here?",
    answer: "The answer to question 4 goes here, in a sentence or two.",
  },
  {
    question: "Question 5 goes here?",
    answer: "The answer to question 5 goes here, in a sentence or two.",
  },
];

const Example = () => (
  <Faq
    description="A short line about the questions goes here."
    eyebrow="FAQ"
    items={items}
    layout="split"
    title="Your headline goes here"
  />
);

export default Example;

All open

layout="columns" sets every question with its answer in two columns under a rule each, with nothing to open.

FAQ

Your headline goes here

A short line about the questions goes here.

Question 1 goes here?
The answer to question 1 goes here, in a sentence or two.
Question 2 goes here?
The answer to question 2 goes here, in a sentence or two.
Question 3 goes here?
The answer to question 3 goes here, in a sentence or two.
Question 4 goes here?
The answer to question 4 goes here, in a sentence or two.
Question 5 goes here?
The answer to question 5 goes here, in a sentence or two.
Question 6 goes here?
The answer to question 6 goes here, in a sentence or two.
import { Faq, type FaqItem } from "@produkto/ui/Faq";

const items: FaqItem[] = Array.from({ length: 6 }, (_, at) => ({
  question: `Question ${at + 1} goes here?`,
  answer: `The answer to question ${at + 1} goes here, in a sentence or two.`,
}));

const Example = () => (
  <Faq
    align="start"
    description="A short line about the questions goes here."
    eyebrow="FAQ"
    items={items}
    layout="columns"
    title="Your headline goes here"
  />
);

export default Example;

By topic

topics sets each topic's questions under its own tab, the first open at first.

FAQ

Your headline goes here

A short line about the questions goes here.

import { Faq, type FaqTopic } from "@produkto/ui/Faq";

const topics: FaqTopic[] = ["Tab 1", "Tab 2", "Tab 3"].map((label, at) => ({
  label,
  items: [1, 2].map((n) => ({
    question: `Question ${at * 2 + n} goes here?`,
    answer: `The answer to question ${at * 2 + n} goes here, in a sentence or two.`,
  })),
}));

const Example = () => (
  <Faq
    description="A short line about the questions goes here."
    eyebrow="FAQ"
    muted
    title="Your headline goes here"
    topics={topics}
  />
);

export default Example;

With a contact card

contact sets a card beside the questions to ask your own: an icon, a title, a line and its button.

FAQ

Your headline goes here

A short line about the questions goes here.

Title
Description
import { Faq, type FaqItem } from "@produkto/ui/Faq";
import { BubbleChatIcon } from "@hugeicons/core-free-icons";
import { Icon } from "@produkto/ui/Icon";

const items: FaqItem[] = Array.from({ length: 4 }, (_, at) => ({
  question: `Question ${at + 1} goes here?`,
  answer: `The answer to question ${at + 1} goes here, in a sentence or two.`,
}));

const Example = () => (
  <Faq
    align="start"
    contact={{
      icon: <Icon icon={BubbleChatIcon} />,
      title: "Title",
      description: "Description",
      actions: [{ label: "Primary action", link: "#" }],
    }}
    description="A short line about the questions goes here."
    eyebrow="FAQ"
    items={items}
    title="Your headline goes here"
  />
);

export default Example;

With a contact line

note and actions follow the questions, with a way to ask something else.

FAQ

Your headline goes here

A short line about the questions goes here.

A short line about where to ask something else goes here.

import { Faq, type FaqItem } from "@produkto/ui/Faq";
import type { BlockAction } from "@produkto/ui/Section";

const items: FaqItem[] = [
  {
    question: "Question 1 goes here?",
    answer: "The answer to question 1 goes here, in a sentence or two.",
  },
  {
    question: "Question 2 goes here?",
    answer: "The answer to question 2 goes here, in a sentence or two.",
  },
  {
    question: "Question 3 goes here?",
    answer: "The answer to question 3 goes here, in a sentence or two.",
  },
];

const actions: BlockAction[] = [{ label: "Button", link: "#" }];

const Example = () => (
  <Faq
    actions={actions}
    description="A short line about the questions goes here."
    eyebrow="FAQ"
    items={items}
    note="A short line about where to ask something else goes here."
    title="Your headline goes here"
  />
);

export default Example;

Muted

muted sets the band a shade off the page, so the question cards stand out on it.

FAQ

Your headline goes here

A short line about the questions goes here.

import { Faq, type FaqItem } from "@produkto/ui/Faq";

const items: FaqItem[] = [
  {
    question: "Question 1 goes here?",
    answer: "The answer to question 1 goes here, in a sentence or two.",
  },
  {
    question: "Question 2 goes here?",
    answer: "The answer to question 2 goes here, in a sentence or two.",
  },
  {
    question: "Question 3 goes here?",
    answer: "The answer to question 3 goes here, in a sentence or two.",
  },
];

const Example = () => (
  <Faq
    description="A short line about the questions goes here."
    eyebrow="FAQ"
    items={items}
    muted
    title="Your headline goes here"
  />
);

export default Example;

API Reference

Faq

FaqProps · blocks/Faq/Faq.types.ts
PropTypeDefault
itemsreadonly FaqItem[]-
topicsreadonly FaqTopic[]-
contactFaqContact-
layoutFaqLayout"stacked" | "split" | "columns""stacked"
noteReactNode-
actionsBlockAction[]-
idstring-
eyebrowstring-
titleReactNode-
taglineReactNode-
descriptionReactNode-
alignSectionAlign"start" | "center" | "end""center"
mutedbooleanfalse
structuredDatabooleanfalse
classNamestring-

FaqItem

used by items
PropTypeDefault
questionrequiredstring-
answerrequiredReactNode-

FaqTopic

used by topics
PropTypeDefault
labelrequiredstring-
itemsrequiredreadonly FaqItem[]-

FaqContact

used by contact
PropTypeDefault
iconReactNode-
titlerequiredReactNode-
descriptionReactNode-
actionsBlockAction[]-

BlockAction

used by actions
PropTypeDefault
appearanceButtonAppearance"solid" | "soft" | "outline" | "transparent"-
toneButtonTone"neutral" | "accent" | "destructive" | "success" | "warning" | "info"-
iconReactNode-
iconOnlyboolean-
borderRadiusBlockActionBorderRadius"none" | "xs" | "sm" | "base" | "lg" | "xl" | "full"-
labelrequiredstring-
linkrequiredstring-