Empty
Empty states with three theme-aware illustrations, an optional title, description and actions.
Installation
Add component
pnpm dlx @elyri/cli@latest add emptyExamples
Basic
Title, description and an action — for empty lists, tables and cards.
No projects yet
Projects you create will show up here.
import { Button } from './components/elyri/Button';
import { Empty } from './components/elyri/Empty';
export function Example() {
return (
<Empty title="No projects yet" action={<Button size="sm">Create project</Button>}>
Projects you create will show up here.
</Empty>
);
}Illustrations
default / search / inbox, all colored from theme tokens.
No documents
No results
Inbox zero
import { Empty } from './components/elyri/Empty';
export function Example() {
return (
<div className="demo-ui-grid">
<Empty size="sm" title="No documents" />
<Empty size="sm" variant="search" title="No results" />
<Empty size="sm" variant="inbox" title="Inbox zero" />
</div>
);
}Sizes
sm / md / lg; the illustration scales with the text.
Small
Medium
Large
import { Empty } from './components/elyri/Empty';
export function Example() {
return (
<div className="demo-ui-row">
<Empty size="sm" title="Small" />
<Empty size="md" title="Medium" />
<Empty size="lg" title="Large" />
</div>
);
}Custom image
Swap the illustration via image, or pass null to keep only the text.
All clear
Nothing left to review.
No activity
Recent changes will appear here.
import { Empty } from './components/elyri/Empty';
const checkIcon = (
<svg width="56" height="56" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round">
<circle cx="12" cy="12" r="9" />
<path d="m8 12.5 2.5 2.5L16 9.5" />
</svg>
);
export function Example() {
return (
<div className="demo-ui-row">
<Empty image={checkIcon} title="All clear">
Nothing left to review.
</Empty>
<Empty image={null} title="No activity">
Recent changes will appear here.
</Empty>
</div>
);
}Props
| Prop | Type | Default | Description |
|---|---|---|---|
variant | 'default' | 'search' | 'inbox' | 'default' | Built-in illustration: default / search / inbox |
size | 'sm' | 'md' | 'lg' | 'md' | Size: sm / md / lg |
image | ReactNode | — | Custom illustration overriding the built-in one; pass null to hide it |
title | ReactNode | — | Title |
action | ReactNode | — | Footer actions |
children | ReactNode | — | Description |
...rest | HTMLAttributes | — | Remaining props are forwarded to the native div |