FAQs
ProA marketing-ready frequently-asked-questions section built on the Accordion. It pairs a header with a single-expand question list and an optional contact CTA, in a centered stack or a sticky two-column split.
Installation#
Usage#
The preview is yours to explore. Its code comes with a Pro license, paid once and used in every project.
Have a license? Unlock it here
Anatomy#
import {
Faqs,
FaqsHeader,
FaqsTitle,
FaqsDescription,
FaqsGroup,
FaqsList,
FaqsItem,
FaqsFeedback,
FaqsFooter,
} from "@/components/ui/faqs"
<Faqs>
<FaqsHeader>
<FaqsTitle />
<FaqsDescription />
</FaqsHeader>
<FaqsList>
<FaqsItem>
<FaqsFeedback />
</FaqsItem>
</FaqsList>
<FaqsGroup>
<FaqsItem />
</FaqsGroup>
<FaqsFooter />
</Faqs>Stacked layout#
The default layout="stacked" centers the header above a width-constrained list. It is the classic centered FAQ, ideal at the foot of a landing page. Set a defaultValue on FaqsList (matching a FaqsItem value) to open the first answer so the section never reads as an empty stack of triggers.
Split layout#
Set layout="split" for a two-column grid: a header column that stays sticky while the list scrolls beside it (the Stripe / Linear FAQ). The columns stack on mobile, and FaqsFooter spans both columns underneath.
Grouped by topic#
For a long, categorized help center, slot FaqsGroups between the header and footer. Each takes a title (an <h3> under the section <h2>) and an optional description, then wraps its own questions, so the page reads header → topic → questions → topic. Each group owns its own list, so single-expand is scoped to the topic and the hairline dividers reset at every boundary. It defaults to the borderless minimal list, and still forwards every FaqsList prop (variant, defaultValue, iconPosition, …).
Landing scale#
size="lg" on Faqs is the landing-page FAQ: topic headings big enough to scan the page by, and every list inside defaults to the Accordion's own lg step (an 18px semibold question on a taller row), so questions and topics step up together. The first topic sits flush, because a landing FAQ usually has its lede in a SectionHeader above the block. Pair it with marker="plus".
List style#
FaqsList forwards straight to the Accordion, so its variant controls the chrome: card (the default: one bordered box with shared dividers), minimal (borderless rows divided by hairlines), or separated (each item its own bordered box). None of those three paints a fill, so the list takes the ground it sits on, whether that is the page or a muted band. The fourth, pill, is the chip list: a closed question hugs its own text and the open one floods into a filled card, for a short FAQ sitting beside a picture rather than filling the measure on its own.
Helpful feedback#
For a help-center / knowledge-base FAQ, set iconPosition="leading" on FaqsList to move the caret ahead of the question, and add feedback to a FaqsItem to mount a Helpful / Not helpful voting row beneath its answer. The chosen pill stays emphasized while the other dims, and an acknowledgement fades in. For full control (custom labels, an onVote handler), drop a FaqsFeedback into the answer yourself.
Footer call to action#
FaqsFooter is an optional closing row for a contact prompt. Drop a line of copy beside one of our Button components; it centers in the stacked layout and spans both columns in the split layout.
Composition#
The parts are plain composition, so a list of questions maps cleanly into FaqsItems. Give each one a stable value when you want to target it with defaultValue; omit it and a unique id is generated for you.
API reference#
Faqs
The section container; provides layout and size to every part. Forwards all native <div> props, and every part accepts className, merged last.
| Prop | Type | Default | Description |
|---|---|---|---|
| layout | "stacked" | "split" | "stacked" | A centered header above a max-w-3xl list, or a two-column grid from lg with a sticky header column. |
| size | "md" | "lg" | "md" | Type scale. lg is the landing FAQ: bigger topic headings, and every list inside defaults to the Accordion's lg step. |
FaqsHeader
The header column for the title, description and anything else you drop in. Forwards all native <div> props.
FaqsTitle
The section heading on the shared section-heading scale. Forwards all native <h2> props.
FaqsDescription
The supporting blurb under the title. Forwards all native <p> props.
FaqsList
The question list: an Accordion (Radix Accordion.Root) with marketing defaults, every one overridable. Forwards all Accordion props.
| Prop | Type | Default | Description |
|---|---|---|---|
| type | "single" | "multiple" | "single" | One open answer at a time, or many. |
| collapsible | boolean | true | Lets the open item close again. single only. |
| variant | "card" | "minimal" | "separated" | "pill" | "board" | "card" | The list chrome: one contour, hairline rows, one box per item, chips that flood open, or a two-up tile grid. |
| size | "md" | "lg" | - | The Accordion type scale, defaulting to the Faqs size; lg sets an 18px semibold question on a taller row. |
| marker | "caret" | "plus" | "caret" | The disclosure mark: a caret that flips, or a plus that turns into a cross. |
| iconPosition | "trailing" | "leading" | "trailing" | Mark after the question, or ahead of it (the help-center look). |
| density | "comfortable" | "compact" | "compact" | Row height and content inset. Falls back to the nearest DensityProvider. |
| defaultValue | string | string[] | - | The item(s) open on mount, uncontrolled; an array with type="multiple". |
| value | string | string[] | - | Controlled open item(s). |
| onValueChange | (value: string | string[]) => void | - | Called when an item opens or closes; the value shape follows type. |
| disabled | boolean | false | Disables every item. |
| Data attribute | Description |
|---|---|
| data-orientation | "vertical", set by Radix. |
FaqsItem
One question and answer: Radix Accordion.Item, Trigger and Content in one call, with the answer as children. Forwards all AccordionItem props.
| Prop | Type | Default | Description |
|---|---|---|---|
| question* | React.ReactNode | - | The question shown in the trigger row. |
| value | string | auto | Unique item value. A stable useId value is generated when omitted; pass one to target it with defaultValue. |
| feedback | boolean | FaqsFeedbackProps | false | Mount a FaqsFeedback row under the answer: true for the defaults, or an object of its props. |
| disabled | boolean | false | Stops the item from opening or closing. |
| Data attribute | Description |
|---|---|
| data-state | "open" or "closed", on the item, trigger and content. |
| data-disabled | Present when the item is disabled. |
| CSS variable | Description |
|---|---|
| --radix-collapsible-content-height | The answer's measured height, read by the open and close height tween. |
FaqsGroup
A topic cluster for a categorized FAQ: an <h3> heading and optional blurb above its own FaqsList, so single-expand is scoped to the topic. Every other prop forwards to that list.
| Prop | Type | Default | Description |
|---|---|---|---|
| title | React.ReactNode | - | The topic heading, rendered as an <h3>. |
| description | React.ReactNode | - | Supporting copy under the topic heading. |
| variant | "card" | "minimal" | "separated" | "pill" | "board" | "minimal" | The inner list's chrome; groups default to borderless rows. |
| className | string | - | Class for the group wrapper (heading and list). |
| listClassName | string | - | Class forwarded to the inner FaqsList. |
FaqsFeedback
A Helpful / Not helpful vote row: a single-select ToggleGroup of two pills, then an acknowledgement. Works anywhere, not only inside Faqs; forwards all native <div> props.
| Prop | Type | Default | Description |
|---|---|---|---|
| onVote | (vote: "up" | "down") => void | - | Called with the chosen vote, e.g. to forward it to analytics. |
| reveal | "always" | "hover" | "always" | hover opens the row with its answer on hover or focus instead of reserving space; it stays open once voted and always shows on touch. |
| label | React.ReactNode | - | A lede before the buttons, e.g. "Was this helpful?". |
| helpfulLabel | React.ReactNode | "Helpful" | Label of the positive pill. |
| notHelpfulLabel | React.ReactNode | "Not helpful" | Label of the negative pill. |
| acknowledgement | React.ReactNode | "Thanks for your feedback." | Shown once a vote is cast; null suppresses it. |
| Data attribute | Description |
|---|---|
| data-voted | "true" once a vote is cast with reveal="hover"; pins the row open. |
FaqsFooter
The closing call-to-action row: centered in stacked, spanning both columns in split. Forwards all native <div> props.
| Prop | Type | Default | Description |
|---|---|---|---|
| size | "sm" | "md" | "lg" | "md" | Control height imposed on the buttons and fields inside; a control's own size still wins. |
| Data attribute | Description |
|---|---|
| data-control-size | The imposed control size. |