FAQ
ProNewA questions section with live search, categories and four layouts: boxed accordion, flat dropdown rows, a plain list and multi-column cards.
Installation
First time? Add the @viewport registry to components.json. Setup takes one minute.
Usage
Props
| Prop | Type | Default |
|---|---|---|
| items* | FaqItem[] | — |
| layout | "accordion" | "dropdown" | "list" | "columns"`accordion` is one bordered box, `dropdown` is flat rows, `list` shows every answer, `columns` lays the answers out as cards. | "accordion" |
| title | stringHeading above the search field. | "Frequently Asked Questions" |
| search | booleanShows the search field. | true |
| placeholder | string | "Search..." |
| categories | FaqCategory[]Groups the questions under these headings, in this order. | — |
| icon | "chevron" | "plus"The mark at the end of each row: a chevron that flips or a plus that turns into a minus. | "chevron" |
| multiple | booleanLets several answers stay open at once. | false |
| defaultOpen | string[]Ids of the questions that start open. | [] |
| accent | stringAny CSS color. Fills the rows and the search field with it and turns the text white. | — |
| columns | 2 | 3Most columns in the `columns` layout. | 2 |
| schema | booleanEmits FAQPage structured data (JSON-LD) for the questions whose answers are plain text. Off by default: enable it once per page, since search engines want a single FAQPage block. | false |
| className | string | — |
Accessibility
- Each question is a heading with a button that reports expanded or collapsed; Enter and Space toggle it.
- The search field is labelled, Escape clears it, and the number of matches is announced politely.
- The list and columns layouts are a description list, so questions and answers stay paired.
- Answers open to their measured height, or instantly under reduced motion.