Something went wrong. Try again.
Our Personal Data Server from scratch!
Something went wrong. Try again.
489 B · 27 lines
Svelte
12345678910111213141516171819202122232425262728<script lang="ts"> import type { Snippet } from 'svelte'
interface Props { title?: string description?: string variant?: 'default' | 'danger' children: Snippet }
let { title, description, variant = 'default', children }: Props = $props()</script>
<section class:danger={variant === 'danger'}> {#if title} <h2>{title}</h2> {/if} {#if description} <p class="description">{description}</p> {/if} {@render children()}</section>