Svelte and SvelteKit 5 · Template syntax
Accept child content
Render the content passed between a component's tags.
<script lang="ts">
let { children } = $props();
</script>
<div class="panel">
{@render children?.()}
</div>
Official Svelte and SvelteKit 5 documentation
More template syntax commands
- Show content conditionally
- Loop over a list
- Show an async result
- Bind form inputs
- Handle events
- Toggle classes
All template syntax commands · Svelte and SvelteKit 5 cheatsheet