Empty
A component to communicate when there's no data, items, or results to display.
When To Use
When there is no data provided, display for friendly tips.
Example Usage
No projects found
Get started by creating a new project or importing an existing one.
astro
---
import Empty from '@/components/data-display/Empty.astro';
import Button from '@/components/general/Button.astro';
---
<Empty
variant="bordered"
title="No projects found"
description="Get started by creating a new project or importing an existing one."
>
<div slot="actions">
<Button variant="primary">Create Project</Button>
<Button variant="outline">Learn More</Button>
</div>
</Empty> With Custom Icon
No results
We couldn't find anything matching your search query. Try different keywords.
astro
---
import Empty from '@/components/data-display/Empty.astro';
import Button from '@/components/general/Button.astro';
---
<Empty
icon="SearchX"
title="No results"
description="We couldn't find anything matching your search query. Try different keywords."
>
<Button slot="actions" variant="outline">Clear Filters</Button>
</Empty> Sizes
Small Empty State
Useful for smaller containers.
Large Empty State
A highly visible empty state for main page areas.
astro
<Empty size="sm" title="Small Empty State" description="Useful for smaller containers." />
<Empty size="lg" title="Large Empty State" description="A highly visible empty state for main page areas." /> API Reference
| Property | Description | Type | Default |
|---|---|---|---|
| variant | The visual style variant of the empty state. | 'default' | 'bordered' | 'default' |
| size | The padding size of the container. | 'sm' | 'md' | 'lg' | 'md' |
| icon | The Lucide icon name to display. | IconName | 'Inbox' |
| title | The main heading text. | string | 'No Data' |
| description | The descriptive text below the title. | string | 'There is currently no data to display.' |
| class | Additional CSS classes to apply. | string | - |