Skip to content
Search
Search the documentation
Accordion
1 min read

Accordion

Collapse long-form content behind expandable headings.

Fold FAQs, optional details, or long asides behind a heading the reader expands on demand, one panel at a time by default, so the page stays scannable.

Usage

Each AccordionItem takes a title (the always-visible summary) and claims its own value automatically, so you never wire up ids. Leave blank lines around the panel content so mdsvex parses the markdown inside.

			<script>
	import { Accordion, AccordionItem } from 'svelte-docsmith';
</script>

<Accordion>
	<AccordionItem title="First question">

Answer with full **markdown**, including `code` and [links](/docs/theming).

	</AccordionItem>
	<AccordionItem title="Second question">

Another answer.

	</AccordionItem>
</Accordion>
		

Pass multiple to let panels stay open independently:

			<Accordion multiple>
	<!-- items -->
</Accordion>
		

API reference

Accordion

multiple boolean default false
Allow several panels open at once.

AccordionItem

title required string
The heading that toggles the panel.
Edit this page Last updated: Jul 12, 2026

Was this page helpful?