Skip to content

Editorial

Editorial FAQ with topic filters.

Usage

Usage
import { FaqEditorial } from '@/components/blocks/faq-04'


<FaqEditorial />


// Your own copy, topics, and several answers open at once
<FaqEditorial
  intro="Everything you need to know before you ship."
  note="Can't find it? Our team answers every email."
  contactHref="/contact"
  type="multiple"
  defaultValue={['billing']}
  items={[
    { id: 'billing', topic: 'Billing', question: 'How does billing work?', answer: 'Monthly or yearly, cancel anytime.' },
    { id: 'setup', topic: 'Product', question: 'How long does setup take?', answer: 'About ten minutes.' },
  ]}
/>

Install

pnpm dlx shadcn@latest add @pastaui-pro/faq-04

Source

Props

Editorial props
PropTypeDefaultDescription
titlestring= 'FAQ'Large section heading with the animated underline.
introstring= Licensing and updates introFirst paragraph of the intro column.
notestring= Contact invitationSecond intro paragraph. Pass an empty string to hide it.
contactLabelstring= 'Contact us'Label of the contact pill. Pass an empty string to hide it.
contactHrefstring= 'mailto:hello@example.com'Where the contact pill links to.
items{ id?: string; topic?: string; question: string; answer: ReactNode }[]= Seven product questionsQuestions to render. id identifies an item in value/defaultValue and falls back to the question text. topic groups items for the filter row.
showTopicsboolean= trueShow the topic filter row when items span two or more topics.
allTopicsLabelstring= 'All'Label of the filter chip that shows every question.
type'single' | 'multiple'= 'single'Whether opening a question closes the others.
valuestring[]= —Controlled list of open item ids.
defaultValuestring[]= []Item ids open on first render when uncontrolled.
onValueChange(value: string[]) => void= —Called with the new list of open item ids whenever a question is toggled.
classNamestring= —Additional classes for the section. Other section props are forwarded.