Skip to content
SENVENLI UI

Empty state

Explains why a view has no content or failed to load, and offers the action that changes that.
First use
import { EmptyState } from "@senvenli/react/feedback";

Examples

No results

Repeats the query and offers the way back.

Compact

The smaller size, for a card or a table.

Check your inbox

A confirmation with a resend that waits between sends (`useCooldownAction`).

A failed load

`tone="danger"` replaces the region that failed, announces it and offers a retry.

Guidelines

When to use it

  • A list or view has nothing to show yet, no results, or failed to load (tone="danger").

Use something else when

  • Content is present and a message about it is needed. Banner
  • The content is still loading. Skeleton

Do and avoid

  • Never blame the user; say what will appear and how to get it.

Accessibility

Built in

  • With announce, the message (title, description, details) is an alert; the actions stay outside it.

You provide

  • A heading level when the state is the page's main content.
  • For a failed load, a retry Button that shows its pending state (see the example).

API reference

EmptyState

iconRequired
IconName

One Lucide icon; no illustrations.

titleRequired
React.ReactNode

First use: what will appear here. No results: repeat the query. Cleared: the calm confirmation.

headingLevel
StateHeadingLevel

Renders the title as a heading where the state is the page's main content; a plain line by default.

description
React.ReactNode

How the content gets here, or the fix; one or two sentences. Never blame the user.

primaryAction
React.ReactNode

The action that fills the view (Button variant="primary"), or "Clear filters" for no results.

secondaryAction
React.ReactNode
size
StateSizeDefault "medium"

compact inside tables and cards.

tone
"neutral" | "danger"Default "neutral"

danger for a load that failed or a page that is not allowed: the icon in the danger tone.

details
React.ReactNode

Extra lines inside the message, under the description: an error code and when it happened, for support.

announce
boolean

Announce the message (title, description, details) as an alert; the actions stay outside it. For a state that replaces content the user was waiting for (a failed load); not for a first-use or no-results state.