# Slots in the Svelte SDK

> Render the child components of a slot with UniformSlot, and show a placeholder when a slot is empty.

Source: https://docs.uniform.app/docs/sdk/svelte/slots

> **Developer preview:**
>
> This feature is in developer preview and may change unexpectedly. For more information, contact support@uniform.dev.

`UniformSlot` renders the child components in one named slot:

```svelte
<UniformSlot name="content" />
```

`name` is required. The slot renders nothing when that name is missing on the component, and it logs a warning in development.

## Component with slots

This page component renders three named slots:

```svelte
<!-- src/lib/components/Page.svelte -->
<script lang="ts">
  import { UniformSlot } from '@uniformdev/canvas-svelte';
  import type { ComponentProps } from '@uniformdev/canvas-svelte';

  interface Props extends ComponentProps<{
    title?: string;
    description?: string;
  }> {}

  let { title, description, component }: Props = $props();
</script>

<svelte:head>
  {#if title}
    <title>{title}</title>
  {/if}
  {#if description}
    <meta name="description" content={description} />
  {/if}
</svelte:head>

<main>
  <header>
    <UniformSlot name="header" />
  </header>
  <UniformSlot name="content" />
  <footer>
    <UniformSlot name="footer" />
  </footer>
</main>
```

## UniformSlot props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `name` | `string` |  | **Required.** The slot name to render |
| `resolveRenderer` | `RenderComponentResolver` | inherited | Override the component resolver for this slot's children |
| `wrapperComponent` | `Component` | `undefined` | A Svelte component that wraps the slot's children |

## Empty slot placeholder

`UniformSlot` supports an `emptyPlaceholder` snippet for when the slot has no items:

```svelte
<UniformSlot name="sidebar">
  {#snippet emptyPlaceholder()}
    <p class="text-gray-400 italic">Drag components here</p>
  {/snippet}
</UniformSlot>
```
