Accordion

A vertically stacked set of expandable sections.

Examples

Installation

Install the package, then import only the components a route uses. Exports are tree-shakable.

Install
pnpm add fractalsvelte
Import
<script lang="ts">
	import { Accordion } from 'fractalsvelte';
</script>

Usage

Usage
<script lang="ts">
	import { Accordion, AccordionItem } from 'fractalsvelte';
</script>

<Accordion>
	<AccordionItem value="a" title="Is it accessible?">Yes.</AccordionItem>
</Accordion>

Props

PropTypeDefaultDescription
type'single' | 'multiple''single'Whether one or several items can be open at once.
variant'plain' | 'outlined' | 'subtle''outlined'The visual treatment of the container.
valuestring[][]The open item values. Supports bind:.

AccordionItem

PropTypeDefaultDescription
valuestring-A unique value identifying this item.
titlestring-The label shown in the trigger.
disabledbooleanfalsePrevents the item from opening.