Got Questions?
Find answers to common questions about our platform
Still have questions?
Contact SupportInstallation
Copy and paste the following code into your project.
import {
Accordion,
AccordionContent,
AccordionItem,
AccordionTrigger,
} from "@/components/ui/accordion";
interface FAQItem {
id: string;
question: string;
answer: string;
}
interface FAQTwoColumnProps {
title?: string;
description?: string;
faqs: FAQItem[];
className?: string;
}
export function FAQTwoColumn({
title = "Frequently Asked Questions",
description = "Everything you need to know about our product and services",
faqs,
className = "",
}: FAQTwoColumnProps) {
// Split FAQs into two columns
const midpoint = Math.ceil(faqs.length / 2);
const leftColumn = faqs.slice(0, midpoint);
const rightColumn = faqs.slice(midpoint);
return (
<section className={`w-full bg-black py-20 ${className} rounded`}>
<div className="mx-auto max-w-7xl px-4 sm:px-6 lg:px-8">
<div className="mx-auto mb-16 max-w-3xl text-center">
<h2 className="mb-4 text-4xl font-bold text-white sm:text-5xl">
{title}
</h2>
<p className="text-lg text-zinc-400">{description}</p>
</div>
{/* Two Column Layout */}
<div className="grid gap-8 lg:grid-cols-2">
{/* Left Column */}
<div>
<Accordion type="single" collapsible className="space-y-4">
{leftColumn.map((faq) => (
<AccordionItem
key={faq.id}
value={faq.id}
className="rounded-xl border border-zinc-800 bg-zinc-950 px-6 data-[state=open]:border-orange-500/50"
>
<AccordionTrigger className="text-left text-base font-semibold text-white hover:text-orange-500 hover:no-underline">
{faq.question}
</AccordionTrigger>
<AccordionContent className="text-zinc-400">
{faq.answer}
</AccordionContent>
</AccordionItem>
))}
</Accordion>
</div>
{/* Right Column */}
<div>
<Accordion type="single" collapsible className="space-y-4">
{rightColumn.map((faq) => (
<AccordionItem
key={faq.id}
value={faq.id}
className="rounded-xl border border-zinc-800 bg-zinc-950 px-6 data-[state=open]:border-orange-500/50"
>
<AccordionTrigger className="text-left text-base font-semibold text-white hover:text-orange-500 hover:no-underline">
{faq.question}
</AccordionTrigger>
<AccordionContent className="text-zinc-400">
{faq.answer}
</AccordionContent>
</AccordionItem>
))}
</Accordion>
</div>
</div>
{/* CTA */}
<div className="mt-16 text-center">
<p className="mb-4 text-zinc-400">Still have questions?</p>
<a
href="#contact"
className="inline-flex items-center gap-2 rounded-lg bg-orange-600 px-6 py-3 font-semibold text-white transition-all hover:bg-orange-700"
>
Contact Support
</a>
</div>
</div>
</section>
);
}install the dependencies.
npx shadcn@latest add accordion
or
pnpm dlx shadcn@latest add accordionFeatures
- ✅ Two-column layout - Side-by-side FAQ organization
- ✅ Accordion functionality - Expand/collapse answers
- ✅ Auto-split - Automatically divides FAQs into columns
- ✅ Hover effects - Interactive orange accent color
- ✅ Open state indicator - Border highlight when expanded
- ✅ Responsive - Stacks on mobile devices
- ✅ CTA section - Built-in contact support button
- ✅ Smooth animations - Radix UI powered transitions
- ✅ Customizable - Title, description, and styling
- ✅ TypeScript support - Full type safety
Usage
Basic Usage
import FAQTwoColumn from "@/components/ui/faq-two-column";
const faqs = [
{
id: "1",
question: "What is your refund policy?",
answer: "We offer a 30-day money-back guarantee...",
},
{
id: "2",
question: "How do I get started?",
answer: "Getting started is easy! Simply sign up...",
},
// ... more FAQs
];
export default function Page() {
return <FAQTwoColumn faqs={faqs} />;
}Custom Title and Description
<FAQTwoColumn
title="Got Questions?"
description="Find answers to common questions about our platform"
faqs={faqs}
/>With Custom Styling
<FAQTwoColumn
faqs={faqs}
className="bg-zinc-900 border-t border-zinc-800"
/>Minimal Example
const faqs = [
{
id: "1",
question: "Question 1?",
answer: "Answer 1",
},
{
id: "2",
question: "Question 2?",
answer: "Answer 2",
},
];
<FAQTwoColumn faqs={faqs} />Props
FAQTwoColumnProps
| Prop | Type | Default | Description |
|---|---|---|---|
faqs | FAQItem[] | Required | Array of FAQ objects |
title | string | "Frequently Asked Questions" | Section title |
description | string | "Everything you need to know..." | Section description |
className | string | "" | Additional CSS classes |
FAQItem
| Prop | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Unique identifier |
question | string | Yes | FAQ question |
answer | string | Yes | FAQ answer |
TypeScript Interface
interface FAQItem {
id: string;
question: string;
answer: string;
}
interface FAQTwoColumnProps {
title?: string;
description?: string;
faqs: FAQItem[];
className?: string;
}Layout
- Desktop (lg+): Two equal columns side-by-side
- Mobile: Single column stacked layout
- Auto-split: FAQs automatically divided evenly between columns
- Spacing: 8px gap between columns, 16px between items
Styling
- Background - Black section with zinc-950 cards
- Borders - Zinc-800 default, orange-500/50 when open
- Text - White questions, zinc-400 answers
- Hover - Orange-500 text color on hover
- CTA Button - Orange-600 with hover effect
- Animations - Smooth accordion transitions
Accordion Behavior
- Single open - Only one item can be open at a time per column
- Collapsible - Click to toggle open/closed
- Independent columns - Each column has its own accordion state
- Smooth animations - Radix UI powered expand/collapse
Responsive Behavior
- Desktop (lg+): Two columns side-by-side
- Tablet (md): Two columns with adjusted spacing
- Mobile: Single column stacked layout
- Padding: Responsive padding adjusts per breakpoint
Use Cases
Perfect for:
- Product pages
- SaaS websites
- Landing pages
- Support sections
- Documentation sites
- Service pages
- Pricing pages
- Help centers
Best Practices
- Number of FAQs - Use 6-12 questions for optimal layout
- Question length - Keep questions concise (under 100 characters)
- Answer length - Provide detailed but scannable answers
- Order - Place most common questions first
- Categories - Group related questions together
- CTA - Always provide a way to contact support
- Updates - Keep FAQs current with product changes
- Testing - Ensure all accordions work on mobile
Customization
Change Accent Color
Replace orange-500 and orange-600 with your brand color:
// In the component
className="data-[state=open]:border-blue-500/50"
className="hover:text-blue-500"
className="bg-blue-600 hover:bg-blue-700"Add Icons
import { HelpCircle } from "lucide-react";
<AccordionTrigger>
<div className="flex items-center gap-2">
<HelpCircle className="h-5 w-5" />
{faq.question}
</div>
</AccordionTrigger>Rich Content Answers
<AccordionContent>
<div className="space-y-2">
<p>{faq.answer}</p>
<a href="#" className="text-orange-500 hover:underline">
Learn more →
</a>
</div>
</AccordionContent>