FAQ Section

FAQ page section with an eyebrow, heading and description column beside an accordion that opens one or many answers with height-morphing panels and a rotating plus, an optional search that narrows questions with spring layout reflow and highlights matches, a Still have questions CTA slot, optional hash deep links, and a layout that splits into two columns based on its own container width.

Preview

FAQ Section preview width

Install

Add it with the shadcn CLI, or copy the source manually.

$ bunx --bun shadcn add @karaui/faq-section
@karaui not found? Add it to components.json
{
  "registries": {
    "@karaui": "https://karaui.kamisama-v0.my.id/r/{name}.json"
  }
}

@karaui is in shadcn's public registry directory, so the latest CLI needs no setup. On an older CLI, merge this into the existing file once and every @karaui/… install resolves.

API Reference

items
FaqItem[]
—
eyebrow?
ReactNode
FAQ
heading?
ReactNode
Frequently asked questions
description?
ReactNode
—
type?
"multiple" | "single"

"single" keeps one answer open at a time; "multiple" lets several stay open.

single
value?
string[]

Controlled open item ids.

—
defaultValue?
string[]

Uncontrolled initial open item ids.

[]
onValueChange?
((value: string[]) => void)
—
searchable?
boolean

Show a search field that narrows and highlights questions.

false
searchPlaceholder?
string
Search questions
emptyState?
((query: string) => ReactNode)

Rendered when the search matches nothing. Receives the query.

—
cta?
ReactNode

"Still have questions?" slot under the header column.

—
deepLink?
boolean

Give each item `id={item.id}`, open the item named by `location.hash` (on mount and on hashchange) and write the hash when an item opens.

false
className?
string
—

Keep in mind

Some components on this site are inspired by or recreated from existing work across the web. I'm not here to take credit; just to learn, experiment, and sometimes push things a bit further. If something looks familiar and I forgot to mention you, reach out and I'll fix that right away.

Updated