Skip to content
Vertical Jump Designs-uiFront-End Studio
Get Pro

v3.9 is out.

Data display

EmptyState

Free15.6 KB gzipped

A friendly, centered block for "no data", "no results", "error", and first-run moments. Pick a kind for sensible default copy, or build your own from icon (or illustration), title, description, actions, and footer.

Accessibility: WCAG 2.2 AA · No A or AA violations in light or dark mode · No keyboard interaction of its own · Full report

Import

tsx
import { EmptyState } from "@vjdesigns/vjdesigns-ui";

Importing only EmptyState adds about 15.6 KB of minified, gzipped JavaScript to your app (React not included). The stylesheet is shared by every component and loaded once: 75.1 KB gzipped.

Examples

No results

kind presets an icon, title and tone for common situations. query names what was searched.

No results for “blue sneakers”

Try a shorter search, or check the spelling.

tsx
import { Button, EmptyState } from "@vjdesigns/vjdesigns-ui";

export function NoResults() {
  return (
    <EmptyState
      kind="no-results"
      query="blue sneakers"
      description="Try a shorter search, or check the spelling."
      actions={<Button variant="outline" tone="neutral">Clear filters</Button>}
    />
  );
}

First run

Create your first project

Projects keep your designs, tasks and files in one place.

tsx
import { Button, EmptyState, PlusIcon } from "@vjdesigns/vjdesigns-ui";

export function FirstRun() {
  return (
    <EmptyState
      kind="first-run"
      variant="card"
      title="Create your first project"
      description="Projects keep your designs, tasks and files in one place."
      actions={<Button startIcon={<PlusIcon />}>New project</Button>}
    />
  );
}

Error with retry

onRetry adds a retry button; retrying shows its loading state.

Something went wrong

We couldn't load your invoices. Check your connection and try again.

tsx
import { useState } from "react";
import { EmptyState } from "@vjdesigns/vjdesigns-ui";

export function ErrorWithRetry() {
  const [retrying, setRetrying] = useState(false);
  return (
    <EmptyState
      kind="error"
      size="sm"
      description="We couldn't load your invoices. Check your connection and try again."
      retrying={retrying}
      onRetry={() => {
        setRetrying(true);
        setTimeout(() => setRetrying(false), 1500);
      }}
    />
  );
}

Accessibility

announce="polite" reads the empty state out when it appears and again when its message changes (try searching for something else), using role="status". headingLevel fits it into the page's heading outline.

No results for “blue sneakers”

Try a different search or clear your filters.

tsx
import { useState } from "react";
import { Button, EmptyState, Stack } from "@vjdesigns/vjdesigns-ui";

export function Accessibility() {
  const [query, setQuery] = useState("blue sneakers");
  return (
    <Stack gap={4} align="center">
      <Button
        size="sm"
        variant="outline"
        tone="neutral"
        onClick={() => setQuery((q) => (q === "blue sneakers" ? "red boots" : "blue sneakers"))}
      >
        Search for something else
      </Button>
      <EmptyState kind="no-results" query={query} headingLevel={3} announce="polite" />
    </Stack>
  );
}

Translated

The kind presets' titles, descriptions and the retry button come from the locale (Japanese here). Each can still be overridden with its own prop.

問題が発生しました

読み込めませんでした。もう一度お試しください。

tsx
import { EmptyState, LocaleProvider } from "@vjdesigns/vjdesigns-ui";
import ja from "@vjdesigns/vjdesigns-ui/locales/ja";

export function Translated() {
  return (
    <LocaleProvider locale="ja" messages={ja}>
      <EmptyState kind="error" headingLevel={3} onRetry={() => {}} />
    </LocaleProvider>
  );
}

Right to left

The first example again, inside a right-to-left LocaleProvider (Arabic). Layout, spacing and arrow icons mirror, and the components' built-in text is translated. The example's own text stays in English.

No results

لا توجد نتائج لـ «blue sneakers»

Try a shorter search, or check the spelling.

tsx
import { LocaleProvider } from "@vjdesigns/vjdesigns-ui";
import ar from "@vjdesigns/vjdesigns-ui/locales/ar";

// NoResults is the "No results" example above.
<LocaleProvider locale="ar" messages={ar}>
  <NoResults />
</LocaleProvider>

Usage notes

Accessibility:

  • Icons and illustrations are decorative (aria-hidden); the title and description carry the meaning.
  • The title is a real heading (headingLevel, default 2).
  • With announce, a visually hidden live region (role="status", or role="alert" for "assertive") is filled just after mount, so screen readers reliably read the result of a search or filter. Without it, nothing is announced; use that for states present on page load.
  • If you give the root a landmark role (e.g. "region"), it is labelled by the title automatically.

API reference

EmptyState

EmptyState props
PropTypeDefault
kind

Preset with a default icon, tone, title, and description. Every one of those can still be overridden with its own prop (e.g. to translate).

"no-data""no-results""error""offline""no-access""first-run"—
query

For kind="no-results": the search text, shown in the default title as No results for "query". Pass your own title to translate it.

string—
icon

Icon shown large inside the soft tinted blob. Pass a built-in Icon (it is resized to fit). Always decorative: hidden from assistive technology. Pass null to hide a preset's icon.

ReactNode—
illustration

Custom art (an SVG or image) that replaces the icon blob. Treated as decorative and hidden from assistive technology, so the title and description must carry the meaning.

ReactNode—
title

Bold display heading. Overrides the preset title.

ReactNode—
headingLevel

Heading level, chosen to fit the page outline (e.g. 3 inside a card under an h2).

1234562
description

Supporting text under the title. Overrides the preset description.

ReactNode—
actions

Primary and secondary actions, usually Buttons or Links. Rendered after the retry button.

ReactNode—
onRetry

Shows a "Try again" button (first in the actions row) and calls this when it is pressed. Works with any kind; most useful with error and offline.

() => void—
retryLabel

Label of the retry button. Localize it here.

ReactNode"Try again"
retrying

Shows the retry button in its loading state while a retry is in flight.

booleanfalse
footer

Small trailing content, such as a "Learn more" link.

ReactNode—
tone

Color of the icon blob.

"neutral""primary""info""success""warning""danger"the preset's tone, otherwise "neutral"
size

Scale: sm inside a card or table, md in a panel, lg for a full page.

"sm""md""lg""md"
align

Content alignment.

"center""start""center"
variant

Surface style.

"plain""card""subtle""plain"
announce

Announce the empty state to screen readers when it appears (or when its message changes, e.g. a new query). "polite" uses role="status"; "assertive" uses role="alert" and should be kept for errors.

false"polite""assertive"false
announceMessage

Text announced when announce is set. Defaults to the title and description when they are plain strings; pass this when either is JSX.

string—

Also accepts native <div> attributes, plus className, style and ref.

See what changed in each version in the Changelog.

Accessibility report

EmptyState targets WCAG 2.2 AA. Below: a live axe-core audit of this page's examples, Lighthouse scores for the page in both modes, the accessibility behavior built into the component, and the checks only a person can do.

axe-core audit (live)

Running accessibility audit

Checking the examples above…

Lighthouse audit

Light mode

Score 100

35 passed · 0 failed · 30 not applicable · 10 to check by hand

Dark mode

Score 100

35 passed · 0 failed · 30 not applicable · 10 to check by hand

Lighthouse 13.5.0 audits the whole docs page (header and sidebar included), not just the examples, in English. Last run 11/27/2026. Some failed audits carry no weight in the score, so a page can score 100 and still list one.

Built-in behavior

Keyboard

Not focusable, so there's no keyboard interaction of its own.

Roles and states

Roles and states
ElementRoleStates and properties
TitleheadingLevel from headingLevel
Iconnonearia-hidden="true"
With announcestatus or alertaria-live polite or assertive

Manual checks

Automated tools find roughly a third of accessibility issues. Test these in your app, with your content.

Manual accessibility checks
CheckWhat to testWCAG 2.2
KeyboardEvery action works with Tab, Shift+Tab, Enter, Space and the arrow keys, and focus never gets stuck.2.1.1 (A), 2.1.2 (A)
FocusFocus moves in a logical order, is always visible, and isn't hidden behind sticky headers.2.4.3 (A), 2.4.7 (AA), 2.4.11 (AA), 2.4.13 (AAA)
Screen readersNames, roles and states are announced correctly, and status changes are announced without moving focus.1.3.1 (A), 4.1.2 (A), 4.1.3 (AA)
ColorMeaning never depends on color alone; your own colors meet contrast in both modes.1.4.1 (A), 1.4.3 (AA), 1.4.11 (AA), 1.4.6 (AAA)
Zoom and reflowAt 200% text size and at 320px wide (400% zoom), nothing is cut off and no sideways scrolling is needed.1.4.4 (AA), 1.4.10 (AA), 1.4.12 (AA)
Pointer targetsClick and tap targets are at least 24×24px (44×44px for AAA), or spaced so they don't overlap.2.5.8 (AA), 2.5.5 (AAA)
MotionAnimations respect the reduced-motion setting.2.3.3 (AAA)