Kumo Svelte
  • Home
  • Installation
  • Colors
  • Accessibility
  • Changelog
  • Autocomplete
  • Badge
  • Banner
  • Breadcrumbs
  • Button
  • Checkbox
  • Clipboard Text
  • Cloudflare Logo
  • CodeHighlighted
  • Collapsible
  • Combobox
  • Command Palette
  • Date Picker
  • Dialog
  • Dropdown
  • Empty
  • Flow
  • Grid
  • Input
  • InputArea
  • InputGroup
  • Label
  • Layer Card
  • Link
  • Loader
  • MenuBar
  • Meter
  • Pagination
  • Popover
  • Radio
  • Select
  • Sensitive Input
  • Sidebar
  • Skeleton Line
  • Switch
  • Table
  • Table of Contents
  • Tabs
  • Text
  • Toast
  • Toolbar
  • Tooltip
  • Charts
  • Colors
  • Timeseries
  • Maps
  • Sankey
  • Custom Chart
  • Page Header
  • Resource List
  • Delete Resource
Empty
kumo-svelte

Empty

A component to display when there's no content or data to show, with an optional copyable command and actions.

No packages found

Get started by installing your first package.

$ npm install kumo-svelte
<script lang="ts">
  import { Button } from "kumo-svelte/components/button";
  import { Empty } from "kumo-svelte/components/empty";
  import CodeIcon from "phosphor-svelte/lib/CodeIcon";
  import GlobeIcon from "phosphor-svelte/lib/GlobeIcon";
  import PackageIcon from "phosphor-svelte/lib/PackageIcon";
</script>

<Empty
  title="No packages found"
  description="Get started by installing your first package."
  command="npm install kumo-svelte"
>
  {#snippet icon()}
    <PackageIcon size={48} />
  {/snippet}

  <div class="flex items-center gap-2">
    <Button icon={CodeIcon}>See examples</Button>
    <Button icon={GlobeIcon} variant="primary">View documentation</Button>
  </div>
</Empty>

Import

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

Usage

<script lang="ts">
  import { Empty } from "kumo-svelte/components/empty";
  import PackageIcon from "phosphor-svelte/lib/PackageIcon";
</script>

<Empty
  title="No packages found"
  description="Get started by installing your first package."
  command="npm install kumo-svelte"
>
  {#snippet icon()}
    <PackageIcon 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/components/empty";
</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 { Empty } from "kumo-svelte/components/empty";
  import DatabaseIcon from "phosphor-svelte/lib/DatabaseIcon";
</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()}
        <DatabaseIcon size={32} class="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()}
        <DatabaseIcon size={48} class="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()}
        <DatabaseIcon size={64} class="text-kumo-inactive" />
      {/snippet}
    </Empty>
  </div>
</div>

With Command

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 { Empty } from "kumo-svelte/components/empty";
  import FolderOpenIcon from "phosphor-svelte/lib/FolderOpenIcon";
</script>

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

With Actions

Add custom action buttons as child content.

No connection

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

<script lang="ts">
  import { Button } from "kumo-svelte/components/button";
  import { Empty } from "kumo-svelte/components/empty";
  import CloudSlashIcon from "phosphor-svelte/lib/CloudSlashIcon";
</script>

<Empty
  title="No connection"
  description="Unable to connect to the server. Please check your connection and try again."
>
  {#snippet icon()}
    <CloudSlashIcon size={48} class="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/components/empty";
</script>

<Empty title="Nothing here" />

API Reference

Empty

PropTypeDefault
childrenSnippet—
classstring—
commandstring—
descriptionstring—
iconSnippet—
sizeKumoEmptySizeKUMO_EMPTY_DEFAULT_VARIANTS.size
title*string—

On this page

  • Import
  • Usage
  • Examples
    • Basic
  • Sizes
  • With Command
  • With Actions
  • Minimal
  • API Reference
    • Empty