Display · Empty Statestable
Empty State
Fills a page, table or card that has no content yet. It explains why it is empty and what to do next. Default or compact size, optional dashed border, icon tile and actions, and an error form.
Preview
#previewChange the options and the code follows. Show code opens the React snippet.
No transactions yet
When customers pay you, their transactions show up here.
empty-state-example.tsx
import { EmptyState } from "@blade-ai/weft/components/empty-state";
<EmptyState
icon={SearchIcon}
title="No transactions yet"
description="When customers pay you, their transactions show up here."
actions={<Button>Create payment link</Button>}
/>All states
#all-statesSize and border combinations, a no-results example and an error example, from the Empty State artboard.
Props
#propsRead from the component source. Booleans are is-prefixed. A star marks a required prop.
Prop
Type
Default
Description
title *
string
—
Short heading, e.g. "No transactions yet".
description
ReactNode
—
One or two sentences on why it is empty and what to do.
icon
IconComponent
—
Icon in the square tile. Drawn at 24px (18px when compact).
actions
ReactNode
—
Buttons under the text, usually a primary and a secondary Button.
size
"default" | "compact"
"default"
"default" is 440px wide; "compact" is 320px for cards and side panels.
border
"none" | "dashed"
"none"
"dashed" draws a dashed container border.
isError
boolean
false
Use role="alert" for errors (e.g. a failed load) so the message is announced.
Usage
#usageShort rules for choosing and writing empty state.
Do
Say what is missing and why, in plain words, without blaming the user.
Offer one clear next step, with a secondary link only if it helps.
Keep it where the content would be.
Don't
Add several competing buttons.
Use an empty state for a loading screen; use a Skeleton Loader.
Leave a blank space with no explanation.
Accessibility
#accessibilityA status message in place of content. Errors are announced.
ARIA
Element
Role / attribute
When
EmptyState
role="status"
Default.
Error empty state
role="alert"
isError, for example a failed load.
Icon
aria-hidden="true"
Decorative.
Title
heading text
Use real buttons or links in actions with specific labels.