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

@isoftdata/svelte-card

Package Overview
Dependencies
Maintainers
13
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@isoftdata/svelte-card

latest
npmnpm
Version
1.4.0
Version published
Weekly downloads
77
352.94%
Maintainers
13
Weekly downloads
 
Created
Source

Svelte Card

Install

pnpm i @isoftdata/svelte-card

This component requires Svelte 5 or later

Need to have multiple cards used in an accordion fashion? Use the Accordion component instead.

Props

All props are optional

NameTypeDescriptionDefault Value
colorColorsBootstrap color variant for the cardundefined
stylestringCustom CSS styles for the cardundefined
headerstring | SnippetCard header content (string or Svelte snippet)undefined
headerClassClassValueCSS classes for the headerundefined
bodyClassClassValueCSS classes for the card bodyundefined
bodyStylestringCSS styles for the card bodyundefined
footerstring | SnippetCard footer content (string or Svelte snippet)undefined
footerClassClassValueCSS classes for the footerundefined
childrenSnippetMain card body contentundefined
flushBodybooleanIf true, removes padding from card bodyundefined
collapsiblebooleanMakes the card collapsible with toggle functionalityfalse
bodyShownbooleanBindable. Controls if the body is visible (when collapsible)true
entireHeaderTogglesbooleanIf true, clicking anywhere in header toggles body visibilityfalse
bodyShownAnimationDurationnumberDuration in milliseconds for body show/hide animation200
disabledbooleanIf true, prevents toggling when collapsiblefalse
shownChange(bodyShown: boolean) => voidCallback when collapsible body is toggledundefined
show() => voidCallback when collapsible body is shownundefined
hide() => voidCallback when collapsible body is hiddenundefined
footerHidesbooleanIf true, hides footer when body is hidden (when collapsible)false

Snippets

  • children - Main content of the card body
  • header - Custom header content (alternative to string header prop)
  • footer - Custom footer content (alternative to string footer prop)

Callbacks

  • shownChange - Called when the collapsible body is toggled, receives boolean indicating visibility state
  • show - Called when the collapsible body is shown
  • hide - Called when the collapsible body is hidden

Example

<script lang="ts">
	import Card from '@isoftdata/svelte-card'
	import { List, Item } from '@isoftdata/svelte-list-group'
</script>

<Card
	collapsible
	header="My Sweet List"
	flushBody
	footer="{items.length} Total Items"
	footerClass="small"
>
	<List flush>
		{#each items as item}
			<Item>{item}</Item>
		{/each}
	</List>
</Card>

Keywords

svelte

FAQs

Package last updated on 24 Jun 2026

Related posts