Command Palette

Search for a command to run...

Docs
FAQ Auto Accordion

FAQ Auto Accordion

A flexible FAQ accordion component with scroll-triggered auto expansion and customizable content.

Loading...

Installation

Usage

import FAQAutoAccordion from "@/components/ruixen/faq-auto-accordion";
 
const faqItems = [
  {
    id: "item-1",
    question: "What is Ruixen UI?",
    answer:
      "Ruixen UI is a modern, fully responsive design system that provides pre-built components, utilities, and layouts to help developers build scalable web applications quickly and efficiently.",
  },
  // Add more FAQ items...
];
 
export default function MyFAQs() {
  return <FAQAutoAccordion faqItems={faqItems} />;
}

Props

PropTypeDefaultDescription
titlestring"FAQ Auto Accordion"The main heading text
descriptionstring"Everything you need to know about Ruixen UI"The subtitle text below the heading
supportTextstring"Can't find what you're looking for? Reach out to our"Text shown before the support link
supportLinkstring"#"URL for the support link
supportLinkTextstring"Ruixen UI support team"Text for the support link
faqItemsFAQItem[]-Array of FAQ items to display
classNamestring-Additional CSS classes
hideSupportbooleanfalseWhether to hide the support text and link

FAQ Item Structure

Each FAQ item should have the following structure:

interface FAQItem {
  id: string; // Unique identifier for the FAQ item
  question: string; // The question text
  answer: string; // The answer text
}

Features

  • Responsive Design: Adapts to different screen sizes with a mobile-first approach
  • Animated Text: Uses BlurredStagger component for smooth text animations
  • Collapsible: Built on shadcn/ui Accordion component for smooth expand/collapse
  • Customizable: All text content, links, and styling can be customized
  • Accessible: Follows accessibility best practices with proper ARIA attributes
  • Dark Mode: Supports both light and dark themes

Examples

Basic Usage

<FAQAutoAccordion faqItems={faqItems} />

Custom Title and Subtitle

<FAQAutoAccordion
  title="Help Center"
  description="Find answers to common questions"
  faqItems={faqItems}
/>

Hide Support Section

<FAQAutoAccordion faqItems={faqItems} hideSupport={true} />
<FAQAutoAccordion
  faqItems={faqItems}
  supportText="Need more help? Contact our"
  supportLink="/contact"
/>