React components
FAQ
An accordion-based FAQ component with SEO support.
Overview
The Faq component displays a list of Frequently Asked Questions using an accordion design. It automatically generates JSON-LD structured data for SEO, making it suitable for FAQ pages.
Usage
import { Faq } from '@/components/core/faq';
const questions = [
{ question: "What is this?", answer: "This is a component." },
{ question: "Is it free?", answer: "Yes." },
];
function FAQPage() {
return (
<div className="container mx-auto">
<h1>FAQs</h1>
<Faq faqs={questions} />
</div>
);
}Props
| Prop | Type | Default | Description |
|---|---|---|---|
faqs | FAQItem[] | Required | Array of FAQ items containing questions and answers. |
Data Interface
interface FAQItem {
question: string;
answer: string;
}