FAQ Accordions
Our documentation includes a custom, reusable <FAQ> component that allows you to create interactive, collapsible accordion menus. This is perfect for organizing long troubleshooting pages or grouping common billing questions.
How to Build Accordions
Section titled “How to Build Accordions”Create clean, collapsible Q&A sections without heavy third-party plugins:
- Use Semantic HTML: Wrap your content in standard HTML
<details>and<summary>tags. - Add Question Text: Place the question string directly inside the
<summary>element. - Wrap the Answer: Enclose the corresponding explanation in paragraph tags below the summary.
Behind the Curtain: FAQ Component
Section titled “Behind the Curtain: FAQ Component”How the interactive accordion renders on the live site.
What is your refund policy?+
We offer a full refund within the first 30 days of your subscription.
To request a refund, please contact Support.
The raw component syntax required to generate the accordion.
import FAQ from '../../../components/FAQ.astro';
<FAQ title="What is your refund policy?">We offer a full refund within the first **30 days** of your subscription.
To request a refund, please contact Support.</FAQ>How authors insert FAQs within the CMS.
To use the FAQ component in your article, you must first import it at the top of your document, and then wrap your content in the <FAQ> tags. Provide the question inside the title="" attribute, and place the answer between the opening and closing tags. You can use standard Markdown (like bolding, lists, and links) inside the answer!
For more details on toggling between visual and raw markdown editing in Sveltia, see Inserting Custom Components (CMS Magic).
