Data Display

Empty

Display an empty state placeholder with an icon or avatar, title, description, and optional action buttons. Useful for empty lists, search results, and onboarding.

Playground

Experiment with different props in real-time.

No items

You have no items in your inbox.

Basic Usage

Provide an icon, title, and description.

No items

You have no items in your inbox.

<script lang="ts">
  import { Empty } from 'sv5ui';
</script>

<Empty
  icon="lucide:inbox"
  title="No items"
  description="You have no items in your inbox."
/>

Variants

4 visual styles.

Outline

Soft

Subtle

Solid

<Empty icon="lucide:inbox" title="Outline" variant="outline" />
<Empty icon="lucide:inbox" title="Soft" variant="soft" />
<Empty icon="lucide:inbox" title="Subtle" variant="subtle" />
<Empty icon="lucide:inbox" title="Solid" variant="solid" />

Sizes

5 sizes controlling typography and padding.

XS

SM

MD

<Empty icon="lucide:inbox" title="Extra Small" size="xs" />
<Empty icon="lucide:inbox" title="Small" size="sm" />
<Empty icon="lucide:inbox" title="Medium" size="md" />
<Empty icon="lucide:inbox" title="Large" size="lg" />
<Empty icon="lucide:inbox" title="Extra Large" size="xl" />

With Actions

Add action buttons with the actions prop.

No results found

Try adjusting your search or filters.

<Empty
  icon="lucide:file-x"
  title="No results found"
  description="Try adjusting your search or filters."
  actions={[
    { label: 'Clear Filters', variant: 'outline', color: 'surface' },
    { label: 'New Search', variant: 'solid' }
  ]}
/>

With Avatar

Use avatar instead of icon for a personalized empty state.

U

No messages

Start a conversation to see messages here.

<Empty
  avatar={{ src: 'https://i.pravatar.cc/150?u=empty', alt: 'User' }}
  title="No messages"
  description="Start a conversation to see messages here."
/>

Custom Snippets

Use snippets to customize individual sections of the empty state.

Get Started

Create your first project to begin.

<Empty variant="soft">
  {#snippet leading()}
    <div class="flex h-16 w-16 items-center justify-center rounded-full bg-primary/10">
      <Icon name="lucide:rocket" class="size-8 text-primary" />
    </div>
  {/snippet}
  {#snippet titleSlot()}
    <h3 class="text-lg font-bold">Get Started</h3>
  {/snippet}
  {#snippet descriptionSlot()}
    <p class="text-on-surface/60 text-sm">Create your first project to begin.</p>
  {/snippet}
  {#snippet actionsSlot()}
    <Button label="Create Project" leadingIcon="lucide:plus" />
  {/snippet}
</Empty>

UI Slots

Use the ui prop to override classes on internal elements.

SlotDescription
rootRoot container — controls layout, background, border, padding
headerHeader container wrapping icon/avatar + title + description
avatarAvatar element styling
titleTitle text — controls font size, weight, color
descriptionDescription text — controls font size and opacity
bodyBody container wrapping actions
actionsActions container — controls layout and gap
footerFooter container

Snippets

Use snippets to customize specific parts of the empty state.

SnippetDescription
leadingCustom content replacing the icon/avatar area
titleSlotCustom title content — overrides title prop
descriptionSlotCustom description content — overrides description prop
actionsSlotCustom actions content — overrides actions prop
headerReplaces entire header area (leading + title + description)
bodyReplaces entire body area (actions)
footerCustom footer content
childrenDefault slot for fully custom content

Props

PropTypeDefault
iconstring-
avatarAvatarProps-
titlestring-
descriptionstring-
actionsButtonProps[]-
variant'solid' | 'outline' | 'soft' | 'subtle''outline'
size'xs' | 'sm' | 'md' | 'lg' | 'xl''md'
askeyof HTMLElementTagNameMap'div'
refHTMLElement | nullnull
classstring-
uiRecord<Slot, Class>-