Command Palette

Search for a command to run...

Docs
Grouped FAQ Section

Grouped FAQ Section

Shadcn FAQ section — a FAQ block organized into named categories. Items collapse with a thin bottom border when closed; on open they lift to a card-style.

Installation

Usage

import GroupedFAQSection from "@/components/ruixen/grouped-faq-section";
 
// Defaults — Installation / Stack Support / Pricing & License
<GroupedFAQSection />;

Custom groups

<GroupedFAQSection
  title="Help Center"
  description="Common questions and answers."
  groups={[
    {
      title: "Account",
      items: [
        {
          question: "How do I sign up?",
          answer: "Visit the signup page at /signup.",
        },
        {
          question: "How do I reset my password?",
          answer: "Click 'Forgot password' on the login screen.",
        },
      ],
    },
    {
      title: "Billing",
      items: [
        {
          question: "When do I get charged?",
          answer: "On the same day each month, starting from your signup date.",
        },
      ],
    },
  ]}
  contactCTA="our team"
  contactHref="/contact"
/>

Props

PropTypeDefaultDescription
titlestring"Frequently Asked Questions"Section heading
descriptionstringDefault copySubheading paragraph
groupsGroupedFAQGroup[]3 default groupsCategorized FAQ groups, each with title and items
contactPromptstring"Can't find what you're looking for? Contact our"Lead text before the contact link
contactCTAstring"support team"Anchor text
contactHrefstring"#"Anchor href
classNamestringExtra classes on the outer <section>

GroupedFAQGroup:

interface GroupedFAQGroup {
  title: string;
  items: GroupedFAQItem[];
}
 
interface GroupedFAQItem {
  question: string;
  answer: string;
}

Notes

  • Built on shadcn's Accordion primitive — works seamlessly across Tailwind v3/v4 and Radix/Base UI registry variants.
  • Closed items render a thin bottom border via the trigger. Open items get the card treatment (rounded corners, ring, shadow, tinted background).
  • type="single" collapsible — only one item open per group at a time.
  • Mobile padding via max-md:px-6; on md+ the groups shift left by -ml-6 to align with the title's natural padding.