> For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt.

# Empty State

Fill an empty screen or list with a centered message, an optional icon, and an action that helps the user get started.


## Installation

```bash
npx @blotch/dolan add empty-state
```

```typescript
import { UiEmptyState } from '../components/ui/empty-state';
```

This also adds [Icon](/dolan/icon.md), which draws the optional icon. Register the icon you name with [`provideIcons()`](/dolan/icon.md#register-the-icons-you-draw).

## Usage

```typescript
import { Component } from '@angular/core';
import { UiEmptyState } from '../components/ui/empty-state';

@Component({
  selector: 'app-no-results',
  imports: [UiEmptyState],
  template: `
    <ui-empty-state
      icon="search"
      title="No results found"
      description="Try adjusting your search or filters."
    />
  `,
})
export class NoResults {}
```

- `title` is required. `icon` and `description` are optional.
- `icon` takes any name from the [Icon](/dolan/icon.md) set, such as `'search'`, `'inbox'` or `'plus'`. It's drawn at the `lg` size.
- `svg` takes your own icon's markup instead, such as your app's mark: `<ui-empty-state [svg]="logo" title="Welcome" />`. `currentColor` in it takes the muted foreground, as the set's icons do, and colors written out stay. `xmlns` is optional, and lines must be `<path>`s, as for [an icon's own SVG](/dolan/icon.md#your-own-svg). Give `icon` or `svg`, not both.

### With an action

Put a button or other content inside. It renders below the description.

```angular-html
<ui-empty-state
  icon="inbox"
  title="No messages"
  description="Messages from your team show up here."
>
  <ui-button (pressed)="compose()">New message</ui-button>
</ui-empty-state>
```

Import [`UiButton`](/dolan/button.md) in your component for this.

## API

### UiEmptyState

| Input         | Type                    | Default     | Description                               |
| ------------- | ----------------------- | ----------- | ----------------------------------------- |
| `title`       | `string`                | Required    | Heading text.                             |
| `description` | `string`                | `''`        | Supporting text below the title.          |
| `icon`        | `IconName \| undefined` | `undefined` | Icon above the title. Give this or `svg`. |
| `svg`         | `string \| undefined`   | `undefined` | SVG markup to draw instead.               |
| `class`       | `string`                | `''`        | Extra Tailwind classes for the container. |

No outputs.

## Related

- [Icon](/dolan/icon.md): every icon name `icon` accepts
- [Button](/dolan/button.md): the action to put inside
- [Card](/dolan/card.md): frame an empty state inside a section
