Skip to content
Onycx-ui
ESC

FAQ Accordion

A two-column FAQ with native disclosure controls that open and close each answer.

Dependencies
No extra packages
Size
153 lines
Controls
8 controls

Installation

CLI · shadcn registry

npx shadcn@latest add https://ui.onycx.dev/r/faq-accordion.json

1 · Dependencies

None beyond React and Tailwind.

2 · Copy the source

components/onycx/faq-accordion.tsx

Requires React 19 and Tailwind CSS v4. Copy the source from the faq-accordion.tsx tab after tweaking: your values are baked in as the new defaults. Exported image examples use portable sample artwork. Replace it with your own media as needed.

Props

PropTypeDefaultDescription
itemsFaqItem[]—{ question, answer } per row. Five studio questions by default.
eyebrow / heading / introstring—Heading column: eyebrow with a 5px dot, uppercase heading (newlines break, *asterisks* set the serif) and a muted line.
showHeadingbooleantrueTwo-column layout; false gives the list the full width.
multiplebooleanfalseWhen false the rows share a details name, so the browser keeps one open.
defaultOpennumber-1Row opened on first render, or -1 for none (the original starts closed).
background / ink / muted / line / accentstring"#f4f6f6" / "#182831" / "#56646c" / "#d1dadd" / "#00638e"Palette; accent is the focus ring.