FaqAccordion
Collapsible Q&A list for detail pages, help centers, and legal sections. Built on Radix Accordion with data-driven items. Defaults to allowing multiple items open simultaneously (Booking.com / Airbnb pattern) with a `single` prop for strict accordion behaviour. Rich ReactNode answers supported for links, lists, and formatted content.
Multi mode (default)
Multiple items can be open at once. Matches how Booking.com and Airbnb handle FAQs — travellers often want to skim several answers without collapsing the previous one.
Frequently asked questions
Single mode — strict accordion
Pass single to enforce that only one item is open at a time. Opening a new item closes the previous one.
Frequently asked questions
Rich content answers
The answer field accepts any ReactNode — pass a string for a simple paragraph, or a JSX tree for links, lists, and formatted content.
Booking details
Pre-opened items via defaultValue
Pass defaultValue={['cancellation', 'meeting-point']} to render specific items expanded on first paint. Useful for surfacing the most-important answers without hiding them behind clicks.
Frequently asked questions
Free cancellation up to 48 hours before departure. Partial refund up to 24 hours before. Non-refundable within 24 hours.
Meet at Circular Quay Wharf 5, 15 minutes before departure. Look for our yellow flag near the ticket booth.
Keyboard behaviour
| Key | Action |
|---|---|
| Space / Enter | Toggle the focused trigger open / closed |
| Tab / Shift+Tab | Move focus to the next / previous trigger |
| Arrow Down / Up | Move focus to the next / previous trigger (Radix built-in) |
| Home / End | Jump to the first / last trigger |
Props reference
| Prop | Type | Required | Description |
|---|---|---|---|
| items | FaqItem[] | yes | Ordered list of Q&A items |
| items[].id | string | yes | Stable id used for state + analytics |
| items[].question | string | yes | Trigger text |
| items[].answer | string | ReactNode | yes | String → rendered as a <p>; ReactNode → rendered as-is |
| title | string | no | Rendered as <h3> above the accordion |
| single | boolean | no (default false) | true → only one item open at a time; false → multiple items allowed open |
| defaultValue | string | string[] | no | Pre-opened item id(s). String in single mode, array in multi mode. |
| value / onValueChange | string ↔ string[] | no | Controlled state — single mode uses string, multi mode uses string[] |
| onItemOpen | (id: string) => void | no | Fires when an item transitions closed → open (analytics hook) |
| className | string | no | Extra classes on the root div |