# EmptyState

Explains why there’s nothing here and what to do next.

- **Use it for**: Explaining why there is nothing here and what to do next.
- **Not for**: Errors or loading. Try [Alert](https://unseenui.com/components/alert/), [Skeleton](https://unseenui.com/components/skeleton/).

## Installation

```bash
npm install @stackunseen/ui
```

## Parts

For the common case, pass `title`, `description`, `icon` and `actions` as props. For full control, compose the parts.

```tsx
<EmptyState>
  <EmptyStateIcon>{icon}</EmptyStateIcon>
  <EmptyStateTitle>No projects yet</EmptyStateTitle>
  <EmptyStateDescription>Your projects will appear here when you add one.</EmptyStateDescription>
  <EmptyStateActions>
    <Button>New project</Button>
  </EmptyStateActions>
</EmptyState>
```

1. **`EmptyState`**: The container. Props cover the common case. Props: `align`, `title`, `description`, `icon`, `actions`, `titleAs`.
2. **`EmptyStateIcon`**: An optional decorative icon.
3. **`EmptyStateTitle`**: Says what is missing. Props: `as`.
4. **`EmptyStateDescription`**: Why it is empty, or how to fill it.
5. **`EmptyStateActions`**: The way forward, such as New project or Clear filters.

## Usage

```tsx
import { EmptyState } from '@stackunseen/ui';
import { EmptyStateTitle, EmptyStateDescription } from '@stackunseen/ui';
import '@stackunseen/ui/styles.css';

<EmptyState><EmptyStateTitle>No projects yet</EmptyStateTitle><EmptyStateDescription>Your projects will appear here when you add one.</EmptyStateDescription></EmptyState>
```

## All props

| Prop | Type | Description |
| --- | --- | --- |
| `actions` | `ReactNode` |  |
| `align` | `"center" \| "start"` |  |
| `description` | `ReactNode` |  |
| `icon` | `ReactNode` |  |
| `title` | `ReactNode` | Shorthand for the common case; compose the parts as children for anything else. |
| `titleAs` | `"h2" \| "h3" \| "h4" \| "h5" \| "h6"` | Heading level for `title`; match the surrounding document. |

## Keyboard

The heading and description remain ordinary content. A recovery action follows native button behavior.

## Works with

[Alert](https://unseenui.com/components/alert/), [Progress](https://unseenui.com/components/progress/), [Toast](https://unseenui.com/components/toast/), [LoadingIndicator](https://unseenui.com/components/loading-indicator/), [Skeleton](https://unseenui.com/components/skeleton/), [StatusBadge](https://unseenui.com/components/status-badge/)

Page: https://unseenui.com/components/empty-state/
