Empty
Eine Komponente, um zu kommunizieren, wenn keine Daten, Elemente oder Ergebnisse anzuzeigen sind.
Wann zu verwenden
Wenn keine Daten bereitgestellt werden, Anzeige für freundliche Tipps.
Beispielverwendung
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> Mit benutzerdefiniertem Symbol
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> Größen
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-Referenz
| Eigenschaft | Beschreibung | Typ | Standard |
|---|---|---|---|
| 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 | - |