FAQ section
FAQs as an accordion, a topic rail, or a searchable list that highlights matches.
npx shadcn@latest add @silicon-ui/faq-sectionInstallation
With the shadcn CLI
npx shadcn@latest add @silicon-ui/faq-sectionManually
Install the dependencies
npm install lucide-react motionCopy these files into your project
- components/silicon-ui/blocks/faq-section/faq-section.tsx
- components/silicon-ui/blocks/faq-section/faq-section.module.css
Shared with other components. Skip any you already have.
- components/silicon-ui/segmented-control/segmented-control.tsx
- components/silicon-ui/segmented-control/segmented-control.module.css
- components/silicon-ui/search-field/search-field.tsx
- components/silicon-ui/search-field/search-field.module.css
- components/silicon-ui/lib/fluid-hover.tsx
Add the foundation, once per app, for the design and motion tokens
npx shadcn@latest add @silicon-ui/silicon-foundation
Usage
API reference
FaqSection
| Prop | Type | Default |
|---|---|---|
variant`accordion` is one centered list, `columns` groups questions beside a category rail, `search` filters as you type. | FaqSectionVariant
| "accordion" |
title | string | "Frequently asked questions" |
description | string | "Everything you need to know before you install your first component." |
items | FaqItem[] | faqExampleItems |
multipleAllow several answers open at once. Defaults to false. | boolean | false |
valueOpen item ids (controlled). | string[] | — |
defaultValueInitially open item ids when uncontrolled. | string[] | — |
onValueChange | (value: string[]) => void | — |
categoryActive category in the columns variant (controlled). | string | — |
onCategoryChange | (category: string) => void | — |
querySearch text in the search variant (controlled). | string | — |
onQueryChange | (query: string) => void | — |
contactA way to reach a person when the answer isn't here. Pass null to hide it. | { label: string; description?: string; href?: string; onClick?: () => void } | null | { label: "Still have a question?", description: "Our team replies within a day." } |
className | string | — |
Also accepts the props of HTMLAttributes.
FaqSectionBlock
| Prop | Type | Default |
|---|---|---|
variant | FaqSectionVariant
| "accordion" |