YYonda UI Docs

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

KeyAction
Space / EnterToggle the focused trigger open / closed
Tab / Shift+TabMove focus to the next / previous trigger
Arrow Down / UpMove focus to the next / previous trigger (Radix built-in)
Home / EndJump to the first / last trigger

Props reference

PropTypeRequiredDescription
itemsFaqItem[]yesOrdered list of Q&A items
items[].idstringyesStable id used for state + analytics
items[].questionstringyesTrigger text
items[].answerstring | ReactNodeyesString → rendered as a <p>; ReactNode → rendered as-is
titlestringnoRendered as <h3> above the accordion
singlebooleanno (default false)true → only one item open at a time; false → multiple items allowed open
defaultValuestring | string[]noPre-opened item id(s). String in single mode, array in multi mode.
value / onValueChangestring ↔ string[]noControlled state — single mode uses string, multi mode uses string[]
onItemOpen(id: string) => voidnoFires when an item transitions closed → open (analytics hook)
classNamestringnoExtra classes on the root div