New:Microsoft Teams Notifications Are Now Available in Socket.Learn more
Get Started

@isoftdata/svelte-accordion

Package Overview
Dependencies
Maintainers
13
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@isoftdata/svelte-accordion

latest
npmnpm
Version
1.1.2
Version published
Maintainers
13
Created
Source

Svelte Accordion Component

Svelte wrapper around the Bootstrap Accordion component.

Screenshot of the attachment component

Install

pnpm i @isoftdata/svelte-accordion

Just need to have a single card that's collapsible? Use the Card component instead.

Components

Accordion

The parent container for accordion items. Manages which item is expanded and ensures only one item can be expanded at a time.

Props

NameTypeDescriptionDefault Value
expandedIdstringID of the currently expanded accordion item''
classClassValueCSS Classes to apply to the accordion div''

Snippets

  • children(default) - the body of the accordion

AccordionItem

Individual accordion items that can be expanded or collapsed.

Props

NameTypeDescriptionDefault Value
idstringUnique identifier for the accordion itemrequired
headerstring | SnippetText to display in the accordion header''
childrenSnippetContent to display when the accordion item is expandedundefined
classClassValueCSS classes to apply to the accordion item div''
headerClassClassValueCSS classes to apply to the header''
buttonClassClassValueCSS classes to apply to the button''
bodyClassClassValueCSS classes to apply to the body''

Snippets

  • children(default) - the body of the accordion item
  • header - The header of the accordion item

Example

<script lang="ts">
	import { Accordion, AccordionItem } from '@isoftdata/svelte-accordion'

	let expandedId = $state('2')
</script>

<Accordion bind:expandedId>
	<AccordionItem
		id="1"
		header="Accordion Item #1"
	>
		Content for the first accordion item.
	</AccordionItem>

	<AccordionItem
		id="2"
		header="Accordion Item #2"
	>
		Content for the second accordion item.
	</AccordionItem>

	<AccordionItem id="3">
		{#snippet header()}
			<h1>Accordion Item #3, but larger</h1>
		{/snippet}
		Content for the third accordion item.
	</AccordionItem>
</Accordion>

Keywords

svelte

FAQs

Package last updated on 24 Jun 2026

Related posts