Layout
EmptyState
A placeholder for empty views with an icon, a title, a description and actions.
<script>
import { EmptyState, Button } from "@codeatlasdev/ui";
import { Inbox } from "@lucide/svelte";
</script>
<EmptyState icon={Inbox} title="No messages yet" description="New messages will appear here.">
{#snippet actions()}<Button size="sm">Compose</Button>{/snippet}
</EmptyState>
#167Basic
Icon, title, description and a primary action.
No messages yet
Your inbox is empty. New messages will appear here.
Reference #167 · Pick in the gallery
Code
<script lang="ts">
import { EmptyState, Button } from '@codeatlasdev/ui';
import { Inbox } from '@lucide/svelte';
</script>
<EmptyState icon={Inbox} title="No messages yet" description="Your inbox is empty. New messages will appear here.">
{#snippet actions()}
<Button variant="filled" size="sm">Compose message</Button>
{/snippet}
</EmptyState>
#170No results
For searches and filters that match nothing.
No results found
Try adjusting your search terms or filters.
Reference #170 · Pick in the gallery
Code
<script lang="ts">
import { EmptyState, Button } from '@codeatlasdev/ui';
import { Search } from '@lucide/svelte';
</script>
<EmptyState icon={Search} title="No results found" description="Try adjusting your search terms or filters.">
{#snippet actions()}
<Button variant="outlined" size="sm">Clear filters</Button>
{/snippet}
</EmptyState>
#171Error or offline
Failed network requests and loading errors.
Couldn't load data
Check your connection and try again.
Reference #171 · Pick in the gallery
Code
<script lang="ts">
import { EmptyState, Button } from '@codeatlasdev/ui';
import { WifiOff } from '@lucide/svelte';
</script>
<EmptyState icon={WifiOff} title="Couldn't load data" description="Check your connection and try again.">
{#snippet actions()}
<Button variant="outlined" size="sm">Retry</Button>
<Button variant="ghost" size="sm">Contact support</Button>
{/snippet}
</EmptyState>
#168Hero
A larger, brand-tinted tile with a glow. On mobile the actions stack full width, so put the primary one first.
Start your first project
Projects keep your sessions, contacts and settings in one place.
Reference #168 · Pick in the gallery
Code
<script lang="ts">
import { EmptyState, Button } from '@codeatlasdev/ui';
import { Inbox } from '@lucide/svelte';
</script>
<EmptyState variant="hero" icon={Inbox} title="Start your first project" description="Projects keep your sessions, contacts and settings in one place.">
{#snippet actions()}
<Button variant="filled">Create project</Button>
<Button variant="ghost">Import</Button>
{/snippet}
</EmptyState>
#169No icon
A minimal version without an icon.
Nothing here yet
Create your first item to get started.
Reference #169 · Pick in the gallery
Code
<script lang="ts">
import { EmptyState, Button } from '@codeatlasdev/ui';
import { Plus } from '@lucide/svelte';
</script>
<EmptyState title="Nothing here yet" description="Create your first item to get started.">
{#snippet actions()}
<Button variant="filled" size="sm">
{#snippet leading()}<Plus size={14} />{/snippet}
Create item
</Button>
{/snippet}
</EmptyState>
#881Dense CRM with component tokens
Six components restyled by tokens on one wrapper.
No activity yet
Calls and visits show up here.
Reference #881 · Pick in the gallery
Code
<script lang="ts">
import { Avatar, Button, Card, EmptyState, SegmentedControl, TextArea, TextField } from '@codeatlasdev/ui';
import { Inbox } from '@lucide/svelte';
let view = $state('day');
let note = $state('');
</script>
<div class="crm">
<Card title="Activity" headingLevel={3}>
<div class="who">
<Avatar alt="Ana Lima" tone="neutral" size="sm" />
<Avatar alt="Bruno Reis" tone="neutral" size="sm" />
<SegmentedControl
aria-label="View"
size="sm"
bind:value={view}
items={[
{ value: 'day', label: 'Day' },
{ value: 'week', label: 'Week' },
{ value: 'month', label: 'Month' },
]}
/>
</div>
<TextField label="Contact" placeholder="Search contacts" />
<TextArea label="Note" rows={1} placeholder="Add a note" bind:value={note} />
<EmptyState bare icon={Inbox} title="No activity yet" description="Calls and visits show up here.">
{#snippet actions()}<Button variant="outlined" tone="neutral" size="sm">Log a call</Button>{/snippet}
</EmptyState>
</Card>
</div>
<style>
/* Component tokens only: no selector against a ca-* class, defaults untouched outside this wrapper. */
.crm {
--ca-avatar-sm-fallback-size: 0.6875rem;
--ca-avatar-fallback-weight: 500;
--ca-field-gap: var(--ca-space-1-5);
--ca-field-label-leading: 1.25;
--ca-ta-min-height: var(--ca-space-16);
--ca-card-bg: var(--ca-surface-raised);
--ca-card-radius: var(--ca-radius-md);
--ca-card-border: var(--ca-border-width) solid var(--ca-outline-subtle);
--ca-card-shadow: none;
--ca-seg-item-padding-x: var(--ca-space-3);
--ca-seg-item-font-size: var(--ca-font-size-caption);
--ca-empty-title-size: var(--ca-font-size-body2);
--ca-empty-title-weight: 500;
max-width: calc(var(--ca-space-unit) * 100);
}
.who { display: flex; align-items: center; gap: var(--ca-space-2); margin-bottom: var(--ca-space-3); }
</style>
Tokens
--ca-empty-padding (default --ca-space-12 --ca-space-6; bare wins), --ca-empty-title-size and --ca-empty-title-weight.
Props
| Prop | Type | Default | Description |
|---|
bare | boolean | false | No padding: an empty state inside a Card, a table or a pane that already insets its content. |
actionsFill | boolean | false | Stacks `actions` full-width at every width (one wide button, an invite form). `variant="hero"` already does it in a narrow slot. |
icon | IconComponent | – | Lucide icon. Size and color are managed by the component. |
title | string | – | Main title. |
headingLevel | 2 | 3 | 4 | 5 | 6 | 2 inside PageShell/AppSettings/AppForm, 5 elsewhere | Heading level of the title. Only the tag changes; the look stays on `.ca-empty__title`. Keeps the outline valid under the page's `<h1>`. |
variant | 'default' | 'hero' | 'default' | 'default' is a compact inline state. 'hero' adds a larger brand-tinted icon tile with a glow and bigger title. |
description | string | – | Supporting text. |
actions | Snippet | – | Call-to-action buttons. |
children | Snippet | – | Extra content below the description. |
class | string | '' | Extra class names. |