Empty State

A placeholder component displayed when there is no data or content to show.

Anatomy

<script>
  import { EmptyState } from "@saas-ui/svelte/components/empty-state";
  import { ShoppingCartIcon } from "lucide-svelte";
</script>

<EmptyState
  icon={ShoppingCartIcon}
  title="Your cart is empty"
  description="Explore our products and add items to your cart"
>
  <Button>Start Shopping</Button>
</EmptyState>

Examples

Alignment Accessibility

Use the align prop to change the alignment of the content.

Basic Accessibility

Basic EmptyState with icon, title, and description.

Colours Accessibility

Use the colour prop to change the colour scheme.

Sizes Accessibility

Use the size prop to change the size of the empty state.

With Action Accessibility

EmptyState with action buttons.

With List Accessibility

EmptyState with a list of suggestions.

Props

Prop Type Default Description
size sm | md | lg md The size of the component.
align centre | start | end centre The alignment of the empty state content.
colour accent | gray | zinc | neutral | stone | slate | red | orange | amber | yellow | lime | green | emerald | teal | cyan | sky | blue | indigo | violet | purple | fuchsia | pink | rose gray The colour theme of the component.
icon boolean - The icon to display.
title text - The title text to display.
description text - The description text to display.
children any - The content to be rendered inside the component.
class text - Additional CSS classes to apply.