# Empty State

> What a screen says when there is nothing to show yet, and the way forward.

- Tier: free, MIT
- Category: Data display
- Docs: https://ui.mlola.com/docs/components/empty-state

## Install

```bash
npx mlola-ui add empty-state
```

```tsx
import { EmptyState } from "@/components/ui/empty-state";
```

## Props with fixed values

| Component | Prop | Values | Default | Description |
| --- | --- | --- | --- | --- |
| EmptyState | `size` | `inline`, `page` | `inline` | "page" centers in a large area; "inline" sits inside a card or table. |

## Example

```tsx
import { IconMail } from "@mlola-ui/icons";
import { Button } from "@/components/ui/button";
import { EmptyState } from "@/components/ui/empty-state";

export default function Example() {
  return (
    <EmptyState
      icon={<IconMail size="1.5em" />}
      title="No messages yet"
      description="New conversations appear here."
      actions={<Button size="sm">Start one</Button>}
    />
  );
}
```

## The same markup without React

```html
<section class="ml-empty" data-size="inline">
  <span class="ml-empty-icon" aria-hidden="true"><svg class="mlola-glyph" width="1.5em" height="1.5em" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="var(--mlola-glyph-stroke, var(--ml-icon-stroke, 1.75))" stroke-linecap="round" stroke-linejoin="round" focusable="false" aria-hidden="true" data-optical-size="default" style="color:var(--mlola-glyph-color, currentColor);scale:var(--mlola-glyph-optical-scale, 1);transform-origin:center"><rect x="3" y="5" width="18" height="14" rx="2" pathLength="1"></rect><path d="m4 7 8 6 8-6" pathLength="1"></path></svg></span>
  <h3 class="ml-empty-title">No messages yet</h3>
  <p class="ml-empty-description">New conversations appear here.</p>
  <div class="ml-empty-actions">
    <button class="ml-button" type="button" data-variant="primary" data-size="sm"><span class="ml-button-label">Start one</span></button>
  </div>
</section>
```
