コンポーネント研究 / FAQ
アコーディオンFAQ
質問を開閉して、回答を必要なときに読めるFAQ。
アコーディオンミニマルサンセリフ1カラム中央配置レスポンシブSaaSスタートアップ
ライブプレビュー
表示幅: 1440px。画面に合わせて縮小しています。原寸での操作や長いセクションの確認には、プレビューを開いてください。
'use client';
import { useState } from 'react';
const COLORS = {
light: {
background: '#FAFAFA',
heading: '#111111',
subheading: '#555555',
question: '#111111',
answer: '#666666',
divider: '#E5E5E5',
arrow: '#999999',
itemBg: '#FFFFFF',
},
dark: {
background: '#0A0A0A',
heading: '#FFFFFF',
subheading: '#999999',
question: '#FFFFFF',
answer: '#999999',
divider: '#1A1A1A',
arrow: '#666666',
itemBg: '#111111',
},
} as const;
interface FaqItem {
question: string;
answer: string;
}
interface SampleFaq1Props {
mode?: 'light' | 'dark';
title?: string;
subtitle?: string;
items?: FaqItem[];
}
const defaultItems: FaqItem[] = [
{
question: '무료 체험은 어떻게 시작하나요?',
answer:
'이메일 주소만으로 14일 무료 체험을 시작할 수 있습니다. 신용카드 정보는 필요하지 않으며, 체험 기간 동안 모든 기능을 사용할 수 있습니다.',
},
{
question: '어떤 프레임워크를 지원하나요?',
answer:
'React, Vue, Angular, 그리고 순수 HTML/CSS 코드 생성을 지원합니다. TypeScript와 JavaScript 모두 지원하며, 프로젝트에 맞는 형식을 선택할 수 있습니다.',
},
{
question: '팀 요금제는 어떻게 되나요?',
answer:
'프로페셔널 요금제부터 최대 10명의 팀원을 초대할 수 있습니다. 엔터프라이즈 요금제는 인원 제한 없이 전체 조직에서 사용할 수 있습니다.',
},
{
question: '데이터 보안은 어떻게 관리되나요?',
answer:
'모든 데이터는 AES-256으로 암호화되며, SOC 2 Type II 인증을 받은 인프라에서 운영됩니다. 분석된 웹사이트 데이터는 사용자 요청 시 즉시 삭제됩니다.',
},
{
question: '환불 정책이 있나요?',
answer:
'유료 요금제 시작 후 30일 이내에 환불을 요청하실 수 있습니다. 환불은 영업일 기준 3-5일 이내에 처리됩니다.',
},
];
export default function SampleFaq1({
mode = 'dark',
title = '자주 묻는 질문',
subtitle = '궁금한 점이 있으신가요? 아래에서 답변을 찾아보세요.',
items = defaultItems,
}: SampleFaq1Props) {
const colors = COLORS[mode];
const [openIndex, setOpenIndex] = useState<number | null>(null);
return (
<section className="px-6 py-24" style={{ backgroundColor: colors.background }}>
<div className="max-w-3xl mx-auto">
<div className="text-center mb-16">
<h2 className="text-4xl md:text-5xl font-bold" style={{ color: colors.heading }}>
{title}
</h2>
<p className="mt-4 text-lg" style={{ color: colors.subheading }}>
{subtitle}
</p>
</div>
<div className="space-y-3">
{items.map((item, i) => (
<div
key={i}
className="rounded-xl overflow-hidden"
style={{ backgroundColor: colors.itemBg }}
>
<button
onClick={() => setOpenIndex(openIndex === i ? null : i)}
className="w-full flex items-center justify-between px-6 py-5 text-left"
>
<span className="text-base font-medium pr-4" style={{ color: colors.question }}>
{item.question}
</span>
<span
className="text-lg transition-transform shrink-0"
style={{
color: colors.arrow,
transform: openIndex === i ? 'rotate(180deg)' : 'rotate(0deg)',
}}
>
▼
</span>
</button>
{openIndex === i && (
<div className="px-6 pb-5">
<p className="text-sm leading-relaxed" style={{ color: colors.answer }}>
{item.answer}
</p>
</div>
)}
</div>
))}
</div>
</div>
</section>
);
}