component Card { props { @event click = function @event action = function @event navigate = function @event dismiss = function @event load = function @event error = function title = "Card title" subtitle = "" description = "" header = "" footer = "" imageSrc = "" imageAlt = "" imagePosition = "top" actionLabel = "" actionHref = "" headerActions = [] navigation = [] activeNav = "" mobileNavigation = false alertTitle = "" alertDescription = "" empty = false emptyTitle = "No data to show" emptyIcon = "icon-[lucide--inbox]" items = [] size = "md" color = "primary" variant = "default" layout = "vertical" align = "left" hover = "none" scrollable = false maxHeight = "18rem" dismissible = false ariaLabel = "" class = "" } state dismissed = false view {
{#if items.length > 0}
{#each items as item, itemIndex} {/each}
{:else}
{#if imageSrc && imagePosition === "overlay"}
{imageAlt}
{/if} {#if imageSrc && (imagePosition === "top" || imagePosition === "left")}
{imageAlt}
{/if}
{#if header || title || subtitle || headerActions.length > 0 || dismissible}
{#if header}

{header}

{/if} {#if title}

{title}

{/if} {#if subtitle}

{subtitle}

{/if}
{#if headerActions.length > 0 || dismissible}
{#each headerActions as headerAction, actionIndex} {/each} {#if dismissible} {/if}
{/if}
{/if} {#if navigation.length > 0} {/if} {#if alertTitle || alertDescription}
{#if alertTitle} {alertTitle} {/if} {#if alertDescription}

{alertDescription}

{/if}
{/if}
{#if empty}

{emptyTitle}

{:else} {#if description}

{description}

{/if} {/if}
{#if footer || actionLabel} {/if}
{#if imageSrc && (imagePosition === "bottom" || imagePosition === "right")}
{imageAlt}
{/if}
{/if}
} }