FAQ
An expandable accordion FAQ component with smooth spring height calculation, single/multi-open modes, category filtering, search, and full ARIA keyboard accessibility.
You can install any component directly using the official shadcn CLI: "npx shadcn@latest add Surajmaurya1/easyui/<component-name>".
Installation
Add the component directly to your repository using shadcn CLI:
npx shadcn@latest add Surajmaurya1/easyui/faq
API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
| items | FAQItem[] | [] | Array of FAQ items with id, question, answer, category, badge, icon |
| allowMultiple | boolean | false | Allows multiple accordion items to remain open simultaneously |
| defaultOpen | string[] | string | undefined | Default expanded item ID(s) on initial mount |
| openIds | string[] | undefined | Controlled list of currently expanded item IDs |
| onOpenChange | (ids: string[]) => void | undefined | Callback fired when open item selection changes |
| iconStyle | 'chevron' | 'plus-minus' | 'custom' | 'chevron' | Indicator icon style |
| searchable | boolean | false | Displays search filter bar above FAQ items |
| showCategories | boolean | false | Displays category filter pills above items |
| variant | 'unified' | 'separated' | 'unified' | Visual presentation layout |