Components
Empty State
A centered placeholder for lists, tables and panels without content.
Installation
$ npx veil-ui@latest add empty-stateUsage
import { Inbox } from "lucide-react";
import { EmptyState } from "@/components/ui/empty-state";
<EmptyState
icon={Inbox}
title="No messages"
description="Messages you receive will show up here."
/>;Examples
Basic
No messages
Messages you receive will show up here.
With action
No projects yet
Create your first project to get started.
Custom content
Nothing to show
Try a different search term.
API reference
| Prop | Type | Default | Description |
|---|---|---|---|
| icon | LucideIcon | — | Decorative icon shown above the copy. |
| title | React.ReactNode | — | Primary message. |
| description | React.ReactNode | — | Supporting explanation. |
| action | React.ReactNode | — | Primary call to action, usually a button. |
Accessibility
- The icon is hidden from assistive technology; the title carries the meaning.
- Actions are real buttons or links supplied by the caller.
Vue and plain HTML
This component also ships for Vue (Reka UI) and plain HTML. Install it with npx veil-ui add empty-state --framework vue or switch the framework in components.json.
<script setup lang="ts">
import { cn } from "@/lib/utils";
import type { EmptyStateProps } from "./types";
const props = defineProps<EmptyStateProps>();
</script>
<template>
<div
data-slot="empty-state"
:class="
cn(
'flex flex-col items-center justify-center gap-3 rounded-lg border border-dashed px-6 py-12 text-center',
props.class,
)
"
>
<div
v-if="icon || $slots.icon"
aria-hidden
class="flex size-10 items-center justify-center rounded-full bg-muted text-muted-foreground"
>
<slot name="icon">
<component :is="icon" class="size-5" />
</slot>
</div>
<div class="grid gap-1">
<p class="text-sm font-medium">
<slot name="title">{{ title }}</slot>
</p>
<p
v-if="description || $slots.description"
class="text-sm text-muted-foreground"
>
<slot name="description">{{ description }}</slot>
</p>
</div>
<slot />
<div v-if="$slots.action" class="mt-2">
<slot name="action" />
</div>
</div>
</template>