Skip to main content
Version: 1.0.3

FAQ Accordion

The FAQ Accordion component provides a flexible and accessible way to display frequently asked questions. It features multiple layout variants, dark themes, smooth animations, and comprehensive customization options through a compound component pattern.

Preview

Centered Layout

Web3 Africa is a community-driven initiative focused on educating and empowering African developers, entrepreneurs, and creators to build and participate in the decentralized web.

Learn more about Web3 Africa

Split Layout

Frequently Asked Questions

Have questions? We're here to help you understand everything about our platform.

Still have questions?

Can't find what you're looking for? Reach out to our support team.

Getting started is easy! Sign up for a free account, complete your profile, and you'll have access to all our basic features.

Vibrant Layout

Electric Blue

Frequently Asked Questions

Everything you need to know about our electric blue theme

We use cutting-edge technologies including React, TypeScript, Node.js, and Web3 libraries. Our stack is carefully chosen for performance, security, and developer experience.

Our platform provides analytics, automation tools, and insights that help you make data-driven decisions. Join thousands of businesses that have grown 3x faster with our solutions.

Installation

ignix add component faqAccordion

Usage

The FAQ Accordion can be used in two ways:

  1. Quick Start: Using the pre-built FAQSection component with all features
  2. Custom Composition: Using the compound components for full control

Type Definitions

type LayoutVariant = 
| 'standard'
| 'split-left'
| 'split-right'
| 'grid'
| 'minimal-list'
| 'contact-sidebar'
| 'category-tabs'
| 'featured';

type ThemeVariant =
| 'light'
| 'dark'
| 'midnight'
| 'charcoal'
| 'ocean'
| 'forest'
| 'sunset';

type AccordionVariant =
| 'default'
| 'card'
| 'bordered'
| 'minimal'
| 'glass'
| 'gradient';

type AnimationVariant =
| 'fade'
| 'slide'
| 'scale'
| 'flip'
| 'reveal';

type type IconStyle =
| 'chevron'
| 'plus-minus'
| 'arrow'
| 'checkmark';

interface FAQItem {
id: string;
question: string;
answer: string;
category?: string;
icon?: React.ReactNode;
link?: {
text: string;
url: string;
};
}

interface FAQCategory {
id: string;
name: string;
count?: number;
icon?: React.ReactNode;
description?: string;
}

interface StatItem {
label: string;
value: string;
icon: React.ReactNode;
}

interface ContactOption {
id: string;
type: 'email' | 'chat' | 'phone' | 'schedule';
label: string;
value: string;
icon: React.ReactNode;
action?: () => void;
}

Props

FAQSection Props

PropTypeDefaultDescription
itemsFAQItem[]RequiredArray of FAQ items to display
categories?FAQCategory[]-Array of categories for filtering
title?string"Frequently asked questions"Section title
description?string"We're happy to answer your questions"Section description
icon?React.ReactNode-Optional icon for the header
layoutVariant?LayoutVariant"standard"Layout style
enableSearch?booleanfalseEnable search functionality
enableCategories?booleanfalseEnable category filtering
enableSingleOpen?booleanfalseAllow only one item open at a time
enableDeepLinking?booleanfalseEnable URL deep linking for FAQ items
enableContactSection?booleanfalseShow contact section
enableStats?booleanfalseShow statistics cards
variant?AccordionVariant"default"Accordion item style
themeVariant?ThemeVariant"light"Theme color scheme
animationVariant?AnimationVariant"slide"Expand/collapse animation
iconStyle?IconStyle"chevron"Expand/collapse icon style
inputVariant?string"clean"Search input style variant
buttonVariant?string"default"Button style variant
customHeader?React.ReactNode-Custom header content
customEmptyState?React.ReactNode-Custom empty state content
customSearch?React.ReactNode-Custom search component
customCategoryFilter?React.ReactNode-Custom category filter component
customContactSection?React.ReactNode-Custom contact section component
customFooter?React.ReactNode-Custom footer content
onItemToggle?(item: FAQItem, isOpen: boolean) => void-Callback when item toggles
onSearch?(query: string) => void-Callback when search changes
onContact?(type: string) => void-Callback when contact option clicked
isLoading?booleanfalseShow loading skeleton
isSearching?booleanfalseShow searching state
contactEmail?string"support@example.com"Contact email
contactPhone?string"+1 (555) 123-4567"Contact phone
contactChat?booleantrueEnable chat contact option
scheduleUrl?string"/schedule"URL for scheduling
stats?StatItem[]Default stats Statistics data
darkMode?booleanfalseForce dark mode
className?string-Additional CSS classes

Accordion Props (Compound Component)

PropTypeDefaultDescription
childrenReact.ReactNodeRequiredAccordion items
defaultValue?string[][]Initially open items
value?string[]-Controlled open items
onValueChange?(value: string[]) => void-Callback when open items change
enableSingleOpen?booleanfalseAllow only one open item
variant?AccordionVariant"default"Visual style
animationVariant?AnimationVariant"slide"Animation style
iconStyle?IconStyle"chevron"Icon style
theme?ThemeVariant"light"Theme
className?string-Additional CSS classes

AccordionItem Props

PropTypeDefaultDescription
idstringRequiredUnique identifier
childrenReact.ReactNodeRequiredItem content
disabled?booleanfalseDisable the item
className?string-Additional CSS classes

AccordionSummary Props

PropTypeDefaultDescription
idstringRequiredID of the parent item
childrenReact.ReactNodeRequiredSummary content
className?string-Additional CSS classes

AccordionTitle Props

PropTypeDefaultDescription
childrenReact.ReactNodeRequiredTitle text/content
icon?React.ReactNode-Optional icon
category?string-Category badge text
className?string-Additional CSS classes

AccordionDetails Props

PropTypeDefaultDescription
idstringRequiredID of the parent item
childrenReact.ReactNodeRequiredDetails content
className?string-Additional CSS classes
PropTypeDefaultDescription
hrefstringRequiredLink URL
childrenReact.ReactNodeRequiredLink text/content
className?string-Additional CSS classes