The user wants a responsive FAQ accordion section with animated expand-and-collapse functionality. Let me create something visually striking and modern, avoiding the typical bland accordion designs.
Key requirements:
Responsive design
Animated expand/collapse
Visually interesting - not a boring template
Good interactions
Accessibility considerations
Design direction:
I'll go for a modern, slightly editorial/technical aesthetic
Use a distinctive font - maybe Space Grotesk for headlines and DM Sans for body
Dark theme with a sharp accent color (maybe cyan or lime green)
Layered background with subtle gradients
Smooth animations with CSS transitions
Staggered entrance animations
Features:
Multiple FAQ items
Smooth height animation (using max-height trick or grid technique)
Rotate icon on expand
Hover states
Focus states for accessibility
Keyboard navigation
Respect prefers-reduced-motion
Let me create this:
FAQ Accordion Section
A modern, visually striking FAQ accordion with smooth animations, staggered entrance effects, and full keyboard accessibility.
html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>FAQ Accordion</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;700&family=DM+Sans:wght@400;500&display=swap" rel="stylesheet">
<style>
:root {
--bg: #0a0a0f;
--bg-elevated: #12121a;
--fg: #f0f0f5;
--muted: #6b6b7a;
--accent: #00ffaa;
--accent-dim: rgba(0, 255, 170, 0.1);
--border: #1f1f2e;
--card: #16161f;
}
* {
box-sizing: border-box;
}
body {
font-family: 'DM Sans', sans-serif;
background: var(--bg);
color: var(--fg);
margin: 0;
min-height: 100vh;
}
.font-display {
font-family: 'Space Grotesk', sans-serif;
}
/* Background atmosphere */
.bg-atmosphere {
position: fixed;
inset: 0;
z-index: 0;
overflow: hidden;
pointer-events: none;
}
.bg-atmosphere::before {
content: '';
position: absolute;
width: 600px;
height: 600px;
background: radial-gradient(circle, rgba(0, 255, 170, 0.08) 0%, transparent 70%);
top: -200px;
right: -100px;
animation: float 20s ease-in-out infinite;
}
.bg-atmosphere::after {
content: '';
position: absolute;
width: 500px;
height: 500px;
background: radial-gradient(circle, rgba(100, 100, 255, 0.05) 0%, transparent 70%);
bottom: -150px;
left: -100px;
animation: float 25s ease-in-out infinite reverse;
}
@keyframes float {
0%, 100% { transform: translate(0, 0) scale(1); }
50% { transform: translate(30px, -30px) scale(1.1); }
}
/* Grid pattern overlay */
.grid-pattern {
position: fixed;
inset: 0;
z-index: 1;
background-image:
linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
background-size: 60px 60px;
pointer-events: none;
}
/* Accordion styles */
.faq-item {
border: 1px solid var(--border);
background: var(--card);
border-radius: 12px;
overflow: hidden;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
opacity: 0;
transform: translateY(20px);
}
.faq-item.visible {
opacity: 1;
transform: translateY(0);
}
.faq-item:hover {
border-color: rgba(0, 255, 170, 0.3);
box-shadow: 0 0 30px rgba(0, 255, 170, 0.05);
}
.faq-item.active {
border-color: var(--accent);
box-shadow: 0 0 40px rgba(0, 255, 170, 0.1);
}
.faq-trigger {
width: 100%;
padding: 1.25rem 1.5rem;
display: flex;
align-items: center;
justify-content: space-between;
gap: 1rem;
background: transparent;
border: none;
color: var(--fg);
cursor: pointer;
text-align: left;
font-family: 'Space Grotesk', sans-serif;
font-size: 1.05rem;
font-weight: 500;
transition: all 0.2s ease;
}
.faq-trigger:hover {
color: var(--accent);
}
.faq-trigger:focus-visible {
outline: 2px solid var(--accent);
outline-offset: -2px;
border-radius: 12px;
}
.faq-number {
font-size: 0.75rem;
color: var(--accent);
font-weight: 700;
letter-spacing: 0.1em;
min-width: 2rem;
}
.faq-icon {
width: 24px;
height: 24px;
border: 2px solid var(--border);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
flex-shrink: 0;
}
.faq-icon svg {
width: 12px;
height: 12px;
stroke: var(--muted);
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.faq-item.active .faq-icon {
background: var(--accent);
border-color: var(--accent);
transform: rotate(180deg);
}
.faq-item.active .faq-icon svg {
stroke: var(--bg);
}
.faq-content {
display: grid;
grid-template-rows: 0fr;
transition: grid-template-rows 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.faq-item.active .faq-content {
grid-template-rows: 1fr;
}
.faq-content-inner {
overflow: hidden;
}
.faq-answer {
padding: 0 1.5rem 1.5rem 4rem;
color: var(--muted);
line-height: 1.7;
font-size: 0.95rem;
}
/* Category pills */
.category-pill {
padding: 0.5rem 1rem;
border-radius: 100px;
border: 1px solid var(--border);
background: transparent;
color: var(--muted);
font-size: 0.875rem;
cursor: pointer;
transition: all 0.2s ease;
font-family: 'DM Sans', sans-serif;
}
.category-pill:hover {
border-color: var(--accent);
color: var(--fg);
}
.category-pill.active {
background: var(--accent);
border-color: var(--accent);
color: var(--bg);
}
.category-pill:focus-visible {
outline: 2px solid var(--accent);
outline-offset: 2px;
}
/* Decorative line */
.accent-line {
width: 60px;
height: 3px;
background: linear-gradient(90deg, var(--accent), transparent);
border-radius: 2px;
}
/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
.faq-item,
.faq-icon,
.faq-icon svg,
.faq-content,
.bg-atmosphere::before,
.bg-atmosphere::after {
transition: none;
animation: none;
}
.faq-item {
opacity: 1;
transform: none;
}
}
</style>
</head>
<body>
<div class="bg-atmosphere"></div>
<div class="grid-pattern"></div>
<main class="relative z-10 min-h-screen py-16 px-4 sm:px-6 lg:px-8">
<div class="max-w-3xl mx-auto">
<!-- Header -->
<header class="mb-12 text-center">
<div class="accent-line mx-auto mb-6"></div>
<p class="text-sm uppercase tracking-widest mb-4" style="color: var(--accent);">Support</p>
<h1 class="font-display text-4xl sm:text-5xl lg:text-6xl font-bold mb-4 leading-tight">
Frequently Asked<br>
<span style="color: var(--accent);">Questions</span>
</h1>
<p class="text-lg max-w-md mx-auto" style="color: var(--muted);">
Everything you need to know about our platform and services.
</p>
</header>
<!-- Category Filter -->
<div class="flex flex-wrap justify-center gap-2 mb-10" role="tablist" aria-label="FAQ categories">
<button class="category-pill active" role="tab" aria-selected="true" data-category="all">All</button>
<button class="category-pill" role="tab" aria-selected="false" data-category="general">General</button>
<button class="category-pill" role="tab" aria-selected="false" data-category="billing">Billing</button>
<button class="category-pill" role="tab" aria-selected="false" data-category="technical">Technical</button>
</div>
<!-- FAQ List -->
<div class="space-y-4" id="faq-container" role="region" aria-label="Frequently asked questions">
<!-- Items will be rendered by JS -->
</div>
<!-- Footer CTA -->
<div class="mt-16 text-center p-8 rounded-2xl" style="background: var(--bg-elevated); border: 1px solid var(--border);">
<p class="text-lg mb-4" style="color: var(--muted);">Still have questions?</p>
<a href="#" class="inline-flex items-center gap-2 px-6 py-3 rounded-lg font-display font-medium transition-all duration-200 hover:scale-105"
style="background: var(--accent); color: var(--bg);">
Contact Support
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M5 12h14M12 5l7 7-7 7"/>
</svg>
</a>
</div>
</div>
</main>
<script>
// FAQ Data
const faqData = [
{
id: 1,
category: 'general',
question: 'What is the typical onboarding process?',
answer: 'Our onboarding process is designed to be seamless. After signing up, you\'ll receive a welcome email with setup instructions. Our team will schedule a 30-minute walkthrough to configure your workspace, integrate your existing tools, and ensure your team is ready to go.'
},
{
id: 2,
category: 'general',
question: 'Can I customize the platform to fit my workflow?',
answer: 'Absolutely. Our platform is built with flexibility in mind. You can create custom workflows, define unique status stages, set up automation rules, and configure dashboards to display the metrics that matter most to your team. Enterprise customers also get access to our API for deeper customization.'
},
{
id: 3,
category: 'billing',
question: 'What payment methods do you accept?',
answer: 'We accept all major credit cards (Visa, Mastercard, American Express), PayPal, and bank transfers for annual plans. For enterprise customers, we also support invoicing with NET-30 terms. All payments are processed securely through Stripe.'
},
{
id: 4,
category: 'billing',
question: 'Is there a free trial available?',
answer: 'Yes, we offer a 14-day free trial with full access to all Pro features. No credit card required to start. At the end of your trial, you can choose to upgrade or continue with our free tier which includes essential features for small teams.'
},
{
id: 5,
category: 'technical',
question: 'How secure is my data on your platform?',
answer: 'Security is our top priority. We use AES-256 encryption for data at rest and TLS 1.3 for data in transit. Our infrastructure is hosted on AWS with SOC 2 Type II compliance. We also offer two-factor authentication, SSO integration, and regular security audits by third-party firms.'
},
{
id: 6,
category: 'technical',
question: 'Do you offer API access and integrations?',
answer: 'Yes, we provide a comprehensive REST API with full documentation. We also offer native integrations with Slack, Microsoft Teams, Jira, GitHub, Linear, and over 50 other tools via Zapier and Make. Enterprise plans include custom integration support.'
},
{
id: 7,
category: 'general',
question: 'What kind of support can I expect?',
answer: 'All users have access to our help center, community forums, and email support with 24-hour response time. Pro users get priority support with 4-hour response time. Enterprise customers receive dedicated account managers, phone support, and guaranteed 1-hour response for critical issues.'
}
];
// State
let activeCategory = 'all';
let openItems = new Set();
// DOM Elements
const container = document.getElementById('faq-container');
const categoryPills = document.querySelectorAll('.category-pill');
// Render FAQ items
function renderFAQs() {
const filteredFAQs = activeCategory === 'all'
? faqData
: faqData.filter(faq => faq.category === activeCategory);
container.innerHTML = filteredFAQs.map((faq, index) => `
<article class="faq-item ${openItems.has(faq.id) ? 'active visible' : ''}"
data-id="${faq.id}"
style="transition-delay: ${index * 50}ms">
<button class="faq-trigger"
aria-expanded="${openItems.has(faq.id)}"
aria-controls="faq-content-${faq.id}"
id="faq-trigger-${faq.id}">
<div class="flex items-center gap-4">
<span class="faq-number">${String(index + 1).padStart(2, '0')}</span>
<span>${faq.question}</span>
</div>
<span class="faq-icon" aria-hidden="true">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<polyline points="6 9 12 15 18 9"></polyline>
</svg>
</span>
</button>
<div class="faq-content"
id="faq-content-${faq.id}"
role="region"
aria-labelledby="faq-trigger-${faq.id}">
<div class="faq-content-inner">
<p class="faq-answer">${faq.answer}</p>
</div>
</div>
</article>
`).join('');
// Trigger entrance animation
requestAnimationFrame(() => {
document.querySelectorAll('.faq-item').forEach((item, i) => {
setTimeout(() => item.classList.add('visible'), i * 50);
});
});
// Add click listeners
document.querySelectorAll('.faq-trigger').forEach(trigger => {
trigger.addEventListener('click', handleToggle);
});
}
// Toggle FAQ item
function handleToggle(e) {
const trigger = e.currentTarget;
const item = trigger.closest('.faq-item');
const id = parseInt(item.dataset.id);
if (openItems.has(id)) {
openItems.delete(id);
item.classList.remove('active');
trigger.setAttribute('aria-expanded', 'false');
} else {
openItems.add(id);
item.classList.add('active');
trigger.setAttribute('aria-expanded', 'true');
}
}
// Category filter
categoryPills.forEach(pill => {
pill.addEventListener('click', () => {
categoryPills.forEach(p => {
p.classList.remove('active');
p.setAttribute('aria-selected', 'false');
});
pill.classList.add('active');
pill.setAttribute('aria-selected', 'true');
activeCategory = pill.dataset.category;
openItems.clear();
renderFAQs();
});
});
// Keyboard navigation
document.addEventListener('keydown', (e) => {
if (e.key === 'Escape') {
openItems.clear();
document.querySelectorAll('.faq-item.active').forEach(item => {
item.classList.remove('active');
item.querySelector('.faq-trigger').setAttribute('aria-expanded', 'false');
});
}
});
// Initialize
renderFAQs();
</script>
</body>
</html>
Design Highlights
Visual Design:
Dark editorial theme with cyan accent (#00ffaa)
Subtle grid pattern overlay for depth
Floating gradient blobs in background for atmosphere
Numbered FAQ items for easy reference
Animations:
Staggered entrance - FAQ items fade in sequentially on load