# ErrorState

A failed content region with an optional retry and supporting actions.

Connect Flood once using [the installation guide](https://flood.md/docs/installation). Then import the components you use; no per-component add command is needed.

## Example

```tsx
"use client";

import { FloodRoot, ErrorState } from "@flood-md/react";
import "@flood-md/react/styles.css";

export function Example() {
  return (
    <FloodRoot>
      <ErrorState title="Could not load project activity" layout="inline" />
    </FloodRoot>
  );
}
```

## Design notes

- Use when content is unavailable because a request failed. Leave still-usable content in place for errors that affect a single action.
- Share EmptyState layout and density in related regions. The row layout keeps recovery at the trailing edge until it needs to wrap below the message.
- Provide onRetry only when the host can retry the request. Use retrying to hold the focused button and its dimensions while the request runs. Restore focus to a persistent destination when the result replaces the error. Announce operation changes through the host's one status region.

## API reference

| Prop | Values | Default |
| --- | --- | --- |
| `title` | `string` | `Required` |
| `description` | `ReactNode` | `—` |
| `icon` | `ReactNode` | `—` |
| `actions` | `ReactNode` | `—` |
| `headingLevel` | `2 \| 3 \| 4 \| 5 \| 6` | `—` |
| `density` | `"compact" \| "comfortable"` | `—` |
| `layout` | `"centered" \| "inline" \| "row"` | `—` |
| `onRetry` | `() => void` | `—` |
| `retryLabel` | `string` | `"Try again"` |
| `retrying` | `boolean` | `false` |
| `Native HTML props` | `Omit<HTMLAttributes<HTMLDivElement>, "title" \| "children">` | `Forwarded` |
