PixelDosa UI

FAQ Section

Answer common product or purchase questions using native disclosure rows.

Questions, answered

A few details that help teams get started.

Can I try it before choosing a plan?
Yes. Start with the free plan and move to a paid plan when your team is ready.
Can I change plans later?
You can change plans as your team's needs evolve. Your workspace stays in place.
Where can I get help?
Every plan includes access to product guidance. Paid plans include priority support.

Installation

bash
npx shadcn@latest add @pixeldosa/faq-section

Requires `cn` at `@/lib/utils`. Use unique ids for each question. Native disclosures are independent and allow multiple answers to remain open simultaneously.

Usage

<FAQSection
  title="Questions, answered"
  items={[
    { id: "trial", question: "Can I try it first?", answer: "Yes, start with the free plan." },
  ]}
/>

Props

PropTypeDefaultDescription
titlestring—Section heading.
descriptionstring—Optional introduction.
itemsFAQItem[]—Questions and React-node answers with stable ids.
density"comfortable" | "compact""comfortable"Spacing preset.
classNamestring—Extra section classes.

why it's built this way

Engineering Notes

Uses the native details/summary disclosure pattern rather than recreating accordion state and keyboard semantics. It supports browser-native keyboard operation and independent open states, with no runtime dependency or forced single-open behavior. Answers remain React nodes so consumers can include links or structured details.

how it moves, and when it doesn't

Motion Notes

The plus indicator rotates using the instant motion token only to reflect open state; the answer itself appears through the browser's native disclosure behavior. Under prefers-reduced-motion the indicator transition is disabled while its orientation and the answer state still communicate the change.