Empty
A container for displaying empty state information.
<script lang="ts">
import { BookOpen, Route } from "@lucide/svelte";
import {
Button,
Empty,
EmptyContent,
EmptyDescription,
EmptyHeader,
EmptyMedia,
EmptyTitle,
} from "coss-svelte";
</script>
<Empty>
<EmptyHeader>
<EmptyMedia data-variant="icon"><Route size={20} /></EmptyMedia>
<EmptyTitle>No upcoming meetings</EmptyTitle>
<EmptyDescription>Create a meeting to get started.</EmptyDescription>
</EmptyHeader>
<EmptyContent>
<div class="flex gap-2">
<Button size="sm">Create meeting</Button>
<Button size="sm" variant="outline"><BookOpen size={16} /> View docs</Button>
</div>
</EmptyContent>
</Empty>
Installation
Install the component package, shared coss-svelte theme, and Bits UI peer.
npm install coss-svelte @coss-svelte/theme bits-uiUsage
Import the Svelte component exports directly from the package.
import { Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle } from "coss-svelte";Anatomy
- Empty
- EmptyContent
- EmptyDescription
- EmptyHeader
- EmptyMedia
- EmptyTitle
API Reference
Empty
A container for displaying empty state information.
children : Snippet<[]>Inherits from Svelte component attributes.
EmptyContent
Wraps the primary content for the parent component.
children : Snippet<[]>Inherits from Svelte component attributes.
EmptyDescription
Provides supporting copy for the parent component.
children : Snippet<[]>Inherits from Svelte component attributes.
EmptyHeader
Groups heading content for the parent component.
children : Snippet<[]>Inherits from Svelte component attributes.
EmptyMedia
Renders the media area for the parent component.
children : Snippet<[]>Inherits from Svelte component attributes.
EmptyTitle
Names the parent surface or section.
children : Snippet<[]>Inherits from Svelte component attributes.
Implementation Details
- Status
- Stable
- Foundation
- native
- Category
- Content & Display
- Particles
- 1