Empty state
An empty state is what a list, table or view shows when it has nothing to show, together with the next step that makes sense. There are two different kinds: no data yet, and no results for the current filter or search. Meadowstack's `DataTable` draws them as two states with two different actions.
By Bohuslav PoláčekChecked
if (total === 0) {
if (isFiltered) {
return (
<div data-state="no-results" className={cn(frame, className)}>
<EmptyState
icon={<IconSearch aria-hidden="true" />}
title={strings.noResultsTitle}
description={strings.noResultsDescription}
action={
onClearFilters ? (
<Button size="sm" onClick={onClearFilters}>
<IconX aria-hidden="true" />
{strings.clearSearch}
</Button>
) : null
}
/>
</div>
);
}
// Marked for the orientation checks (decision 0009): no data at all, unlike the filtered branch above.
return (
<div data-state="empty" className={cn(frame, className)}>
{emptyState ?? <EmptyState />}Why it matters in a business app
"No purchase requests" means one thing on a new account and another when the person typed a supplier's name into the search. The first needs a way to create the first request; the second needs the search cleared. Showing the same "Nothing here" for both sends people off to create a record that already exists.
An empty state is also not a blank screen. A table that renders nothing at all looks broken, and people reload or report a bug.
How Meadowstack handles it
- Four states, always. Every data view loads with
useResource()and renders through<AsyncState>: loading, error with retry, empty, content.npm run check:statesfails on a screen that loads data without it. - Two kinds of nothing.
DataTablemarksdata-state="no-results"with a search icon and a "Clear search" button, ordata-state="empty"with the app's own empty state. - Small on purpose.
EmptyStateis a 32px tile with a 16px icon, a 13px title and one line of help: "an empty table is not a hero moment", as the kit's source puts it. - Not where a visitor lands. The review audit's
no-wallrule checks that the demo's default visitor meets no empty view on any route; a filter with no results is fine.
The data states pattern shows the four states on a full screen.
Common mistakes
- An error dressed as empty. A failed request that shows "No orders" hides the failure. Errors get their own state with a retry.
- "Showing 0 of 0". A count is not a next step.
- A large illustration. In a working app the empty table sits between real content; a hero picture pushes everything else away.
- An action the person may not take. "Create the first invoice" for a role that cannot create invoices is a dead end; hide it.
Questions
What should an empty state say?
What is missing and the one next step: create the first record, change the filter, or connect the data source. One line of help is enough.
Is no results for a search an empty state?
It is a different state. The data exists, the filter hid it, so the next step is to clear or change the filter rather than to create something.
Should an empty state have an illustration?
In a busy business app usually not. Meadowstack's kit uses a small icon tile and a short line, so the empty table does not outweigh the rest of the screen.
Two ways
Build it yourself, or have it built
Build it yourself
Build your app on the framework
Get the codebase these apps stand on and build yours with Claude Code, Cursor or Codex.
One payment, lifetime updates
Get the frameworkHave it built
Have us build your app
Tell us how your team works. We plan the app with you and build it on the same framework at a fixed price.
After launch, Care keeps it improving, from €99 a month.
from €1,990
Describe your app