No packages found

Get started by installing your first package.

$ npm install kumo-svelte
<script lang="ts">
  import { Code, Globe, Package } from 'phosphor-svelte';
  import { Button, Empty } from 'kumo-svelte';
</script>

<Empty
  title="No packages found"
  description="Get started by installing your first package."
  commandLine="npm install kumo-svelte"
>
  {#snippet icon()}<Package class="size-12" />{/snippet}
  <div class="flex items-center gap-2">
    <Button icon={Code}>See examples</Button>
    <Button icon={Globe} variant="primary">View documentation</Button>
  </div>
</Empty>

Installation

Barrel

import { Empty } from 'kumo-svelte';

Granular

import { Empty } from 'kumo-svelte/components/empty';

Usage

<script lang="ts">import { Empty } from "kumo-svelte";import { Package } from "phosphor-svelte";</script><Empty  title="No packages found"  description="Get started by installing your first package."  commandLine="npm install @kumo/ui">  {#snippet icon()}    <Package size={48} />  {/snippet}</Empty>

Examples

Basic

No results found

Try adjusting your search or filter to find what you're looking for.

<script lang="ts">
  import { Empty } from 'kumo-svelte';
</script>

<Empty
  title="No results found"
  description="Try adjusting your search or filter to find what you're looking for."
/>

Sizes

Empty states come in three sizes to fit different container contexts.

Small

No data available

There is no data to display.

Base

No data available

There is no data to display.

Large

No data available

There is no data to display.

<script lang="ts">
  import { Database } from 'phosphor-svelte';
  import { Empty } from 'kumo-svelte';
</script>

<div class="flex flex-col gap-8">
  <div>
    <p class="mb-2 text-sm text-kumo-subtle">Small</p>
    <Empty size="sm" title="No data available" description="There is no data to display.">
      {#snippet icon()}<Database class="size-8 text-kumo-inactive" />{/snippet}
    </Empty>
  </div>
  <div>
    <p class="mb-2 text-sm text-kumo-subtle">Base</p>
    <Empty size="base" title="No data available" description="There is no data to display.">
      {#snippet icon()}<Database class="size-12 text-kumo-inactive" />{/snippet}
    </Empty>
  </div>
  <div>
    <p class="mb-2 text-sm text-kumo-subtle">Large</p>
    <Empty size="lg" title="No data available" description="There is no data to display.">
      {#snippet icon()}<Database class="size-16 text-kumo-inactive" />{/snippet}
    </Empty>
  </div>
</div>

With Command Line

Include a copyable command to help users get started.

No projects found

Get started by creating your first project using the command below.

$ npm create kumo-project
<script lang="ts">
  import { FolderOpen } from 'phosphor-svelte';
  import { Empty } from 'kumo-svelte';
</script>

<Empty
  title="No projects found"
  description="Get started by creating your first project using the command below."
  commandLine="npm create kumo-project"
>
  {#snippet icon()}<FolderOpen class="size-12 text-kumo-inactive" />{/snippet}
</Empty>

With Actions

Add custom action buttons using child content.

No connection

Unable to connect to the server. Please check your connection and try again.

<script lang="ts">
  import { CloudSlash } from 'phosphor-svelte';
  import { Button, Empty } from 'kumo-svelte';
</script>

<Empty
  title="No connection"
  description="Unable to connect to the server. Please check your connection and try again."
>
  {#snippet icon()}<CloudSlash class="size-12 text-kumo-inactive" />{/snippet}
  <div class="flex gap-2">
    <Button variant="primary">Retry</Button>
    <Button variant="secondary">Go Back</Button>
  </div>
</Empty>

Minimal

At minimum, only a title is required.

Nothing here

<script lang="ts">
  import { Empty } from 'kumo-svelte';
</script>

<Empty title="Nothing here" />

API Reference

PropTypeDefaultDescription
size 'sm' | 'base' | 'lg'"base"Size preset.
icon Snippet-Decorative icon displayed above the title.
title *string-Title content.
description string-Supporting description text.
commandLine string-Shell command displayed in a copyable code block.
contents Snippet-Custom empty-state content.
class string-Additional classes merged onto the root element.