1. framework components
  2. accordion

Accordion

Divide content into collapsible sections.



Controlled

Use the open and onOpenChange props to control the state.

Content for item 1

Multiple

Allow multiple accordion items to stay open at once using the multiple prop.

Collapsible

Allow closing all items when one is open using the collapsible prop.

Indicator

Add a custom indicator to accordion triggers.

Orientation

Render the accordion vertically or horizontally using the orientation prop.

Dir

Set the text direction (ltr or rtl) using the dir prop.

Anatomy

Here’s an overview of how the Accordion component is structured in code:

svelte
<script lang="ts">
	import { Accordion } from '@skeletonlabs/skeleton-svelte';
</script>

<Accordion>
	<Accordion.Item>
		<Accordion.ItemTrigger />
		<Accordion.ItemIndicator />
		<Accordion.ItemContent />
	</Accordion.Item>
</Accordion>

API Reference

Unable to load component information for svelte/accordion

View page on GitHub