# Empty State

What a section, tab or page shows when it has nothing in it yet: one line of sentence-case copy that says what will appear, and at most one action.

- Beta: ready to use; its API can still change in a minor release.
- Category: Feedback

```tsx
import { EmptyState } from "@leap-crm/design-system";
```

## Best practices

- Do: Match the layout to the space: `line` under a section header that already carries Add, `inline` for an empty tab, and `stacked` for a whole page with room.
- Do: Use `framed`, with 8 px corners, when it stands alone, and `contained`, with 4 px corners, among filled tables.
- Do: Write `title` as what's missing, like "No tasks yet", and `description` as one sentence on what will appear, like "Tasks you add to this opportunity show here."
- Do: Give it at most one `action`, usually an outline sm `Button` like "Add task".
- Don't: Use it for one empty value, like a contact with no phone number. Use `EmptyValue` in the cell or detail row.
- Don't: Write "Nothing here" or "No data". Name what's missing, so a lawyer knows whether to add something or look elsewhere.

## Related

- [Empty Value](./empty-value.md)
- [Skeleton](./skeleton.md)
- [Alert](./alert.md)

## Examples

What the examples import:

```tsx
import { Inbox, Plus } from "lucide-react";
import { Button, EmptyState } from "@leap-crm/design-system";
```

Scaffolding the examples call. It lives in the docs page, not in the library:

```tsx
const action = (
  <Button intent="outline" size="sm" icon={<Plus />}>
    Add task
  </Button>
);
```

### Stacked

A centred column under the tile, for whole pages with room. Bare, framed (8 px) when it stands alone, or contained (4 px) among filled tables.

```tsx
<div className="flex flex-col gap-4">
  <EmptyState
    icon={<Inbox />}
    title="No tasks yet"
    description="Tasks you add to this opportunity show here."
    action={action}
  />
  <EmptyState
    frame="framed"
    className="w-105"
    icon={<Inbox />}
    title="No tasks yet"
    description="Tasks you add to this opportunity show here."
    action={action}
  />
</div>
```

### Inline

Tile, text and action in a row, for a tab with nothing in it.

```tsx
<div className="flex flex-col gap-4">
  <EmptyState
    layout="inline"
    icon={<Inbox />}
    title="No tasks yet"
    description="Tasks you add to this opportunity show here."
    action={action}
  />
  <EmptyState
    layout="inline"
    frame="contained"
    className="w-140"
    icon={<Inbox />}
    title="No tasks yet"
    description="Tasks you add to this opportunity show here."
    action={action}
  />
</div>
```

### Line

Inside a workspace Overview section: one muted line under the header, which already carries Add.

```tsx
<EmptyState layout="line" title="No tasks yet" />
```

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `layout` | `"stacked" \| "inline" \| "line"` | `"stacked"` | Stacked: tile above a centred column, for whole pages with room. Inline: tile, text and action in a row, for an empty tab. Line: one muted line under a section header that already carries Add. |
| `frame` | `"bare" \| "framed" \| "contained"` | `"bare"` | Bare sits on the page. Framed (8 px) stands alone. Contained (4 px) sits among filled tables. |
| `icon` | `ReactNode` |  | The 16 px icon in the 32 px tile. Not shown in a line. |
| `title` (required) | `ReactNode` |  | Says what's missing, like "No tasks yet". |
| `description` | `ReactNode` |  | One sentence on what will appear here. |
| `action` | `ReactNode` |  | One action, usually an outline sm Button like "Add task". |
| `className` | `string` |  | Classes added to the root element, merged with its own. Tokens only. |
