Feedback

EmptyState

Empty content follows its leading edge. Page placement centres recovery.

import { EmptyState } from '@lostgradient/cinder';
feedbackempty
01

Overview

Reference usage

Placeholder layout for zero-data views, with optional illustration, heading, and action.

Usage

svelte
<script lang="ts">
  import { EmptyState } from '@lostgradient/cinder';
  import { Webhook } from '@lucide/svelte';
</script>

<EmptyState
  title="No hooks yet"
  description="A hook does something when an event happens: send a webhook, start a workflow, or notify you."
  actions={[{ label: 'New hook', href: '/hooks/new' }]}
>
  {#snippet icon()}<Webhook aria-hidden="true" />{/snippet}
</EmptyState>

An empty state is top-aligned under what comes before it, never centred in a tall window or boxed, with the title, sentence and details held to about 60 characters. Its default placement="content" follows the leading edge of a list, table, tab, section or panel. Use placement="page" only when it fills a whole route or dialog body; that placement centres the stack and its action group. There is no size, alignment, border or row variant. A section or tab that is empty shows the state alone: leave out the section's own heading and description when they would say the same thing.

Pick the kind that says why the view is empty. It sets the tint of the 48px disc, and the glyph it shows when you pass no icon:

  • first-use: nothing exists yet. An accent disc that holds the view's own icon, and a primary button as the action. There is no default glyph, so pass the icon.
  • filtered: a filter or search hid items that exist. A neutral disc with a funnel, and a secondary "Clear filters" button from onClearFilters, which is the only action.
  • done: the work is finished. A green disc with a check, and optionally a secondary button as the action.
  • blocked: something the person can fix keeps the view empty. An amber disc with a warning glyph.
  • not-found: the thing asked for doesn't exist. A neutral disc with a magnifying glass.
  • disabled: a setting the person chose (a disabled plugin) holds the content back, so it is not a warning. A neutral disc with a plug.

The state sets its own sans face, so one placed inside a monospace region (a JSON or source viewer) still reads as prose rather than inheriting the region's font.

svelte
<EmptyState
  placement="page"
  kind="not-found"
  title="This run doesn’t exist"
  description="It may have been deleted. The address might also be mistyped."
  actions={[
    { label: 'Back to runs', href: '/runs', variant: 'secondary' },
    { label: 'Search everything', variant: 'secondary' },
  ]}
/>

A title says what is missing or what happened, never an instruction ("No hooks yet", not "Build your first hook"), and the sentence under it is one sentence, with contractions.

svelte
<script lang="ts">
  import { EmptyState } from '@lostgradient/cinder';

  let query = $state('overdue');
</script>

<EmptyState
  kind="filtered"
  title="No runs match these filters"
  description="Model switcher has no runs. Try another agent."
  onClearFilters={() => (query = '')}
/>

<EmptyState
  kind="done"
  title="All caught up"
  description="Nothing is waiting on you. When an agent asks for approval, it shows up here."
  actions={[{ label: 'See past decisions', href: '/reviews/done', variant: 'secondary' }]}
/>

A list page with nothing in it yet puts the state under its PageHeader. The page passes only its title, its sentence, its own icon (the one its navigation item shows) and its actions, which the component draws as buttons, the first primary and the rest secondary; use the header's verb ("New goal", never "Create a goal"). Leave out counts, search and filters until the first item exists.

svelte
<script lang="ts">
  import { EmptyState } from '@lostgradient/cinder';
  import { Target } from '@lucide/svelte';
</script>

<EmptyState
  headingLevel={2}
  title="No goals yet"
  description="A goal runs an agent on a prompt until a check passes."
  actions={[
    { label: 'New goal', href: '/goals/new' },
    { label: 'Ask an agent', href: '/chats/new' },
  ]}
>
  {#snippet icon()}<Target aria-hidden="true" />{/snippet}
</EmptyState>

The action stays buttons: it is a wrapping row of call-to-action controls. Content that belongs under the action, such as the lines and numbered steps of a manual set-up, goes in the component's children, which follow the action in a block of their own at the words' measure:

svelte
<script lang="ts">
  import { Button, EmptyState } from '@lostgradient/cinder';
</script>

<EmptyState
  title="Connect a model provider"
  description="Agents can't answer until one is connected."
>
  {#snippet action()}
    <Button variant="primary" label="Connect a provider" />
  {/snippet}
  <p>Or set it up by hand:</p>
  <ol>
    <li>Save the key in a file.</li>
    <li>Restart.</li>
  </ol>
</EmptyState>

The icon snippet replaces the glyph in the disc. The illustration snippet draws a larger picture above the title in place of the disc; it is decorative and sizes to its own content, so give it an svg or an img of the size you want. The action row wraps with even spacing.

Live preview

Basic empty state

No results found

Try adjusting your filters or search query.

02

When to use

Use when
  • Suggest a next step in an empty list, table, or workspace.
  • Replace content after a search returns no results.
  • Confirming all work is finished (done kind), or that a filter hid every item (filtered kind).
  • Saying a thing doesn't exist (not-found kind), or that a recoverable condition blocks the view (blocked kind).
  • Saying that a setting the person chose, such as a disabled plugin, holds content back with the disabled kind.
  • Centred recovery for a whole route or dialog body with placement="page".
Avoid when
  • Indicating that data is still loading — use skeleton or spinner instead.
  • Reporting a transient error — use alert, banner, or toast-region.
03

Examples

Basic empty state

Title, description, and an action button.

Every kind

Why a view is empty sets the disc: first use is accent with a primary button, filtered is neutral with a secondary Clear filters, done is green with a secondary button, blocked is amber, not-found is neutral and disabled is neutral with a plug, for content a setting you chose holds back.

With icon

An icon snippet above the title.

04

Props

Props for empty-state
Name
Type
Default
Description
title required text Primary heading text rendered as a heading element at the configured headingLevel.
description text Secondary descriptive text rendered as a paragraph below the title.
headingLevel 123456 3 Heading level for the title element.
placement 'content' | 'page' 'content' Where the state sits. Use 'content' for a list, table, tab, section or panel. Use 'page' only when the state fills a whole route or a whole dialog body.
kind 'first-use''filtered''done''blocked''not-found''disabled' 'first-use' Why the view is empty. It sets the disc tint and the default glyph (first use, filtered, done, blocked, not found or disabled). Every kind renders its actions; 'filtered' also adds a secondary "Clear filters" button before them when onClearFilters is set. Give 'first-use' a primary button, 'done' a secondary one, and 'filtered' the Clear filters button alone.
onClearFilters () => void Called when the "Clear filters" button of a 'filtered' state is pressed. The button renders only when this is set.
clearFiltersLabel text 'Clear filters' Label of the "Clear filters" button.
icon snippet Replaces the glyph in the disc. First use shows the view's own icon; every other kind has a default glyph. Decorative, so it is hidden from assistive technology.
illustration snippet A larger picture drawn above the title in place of the disc, for a state that wants more than a glyph. Decorative, so it is hidden from assistive technology; say what is missing in the title.
action snippet Call-to-action content rendered after the actions buttons and the "Clear filters" button. Prefer actions, which are always drawn as buttons; whatever goes here should be a Button too, never a text link.
actions EmptyStateAction[] [] The state's buttons, drawn by the component so they are always buttons, never text links: the first is primary (the page's create action, with the header's verb) and any later one is secondary. They come before the action snippet when both are passed.
actionsLabel text Names the group of buttons when they are a set of choices (such as suggested prompts) and not one call to action: the group is then announced with this name. The group wraps and starts at the leading edge as every empty state's buttons do, so a host never draws a group of its own.
children snippet Supporting content under the buttons, such as the steps of a manual set-up; the action stays buttons. It holds the same measure as the words and draws no border or background.