# LoadingState

A visible loading message that shares spacing and layouts with empty and error states.

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, LoadingState } from "@flood-md/react";
import "@flood-md/react/styles.css";

export function Example() {
  return (
    <FloodRoot>
      <LoadingState label="Loading project activity…" layout="row" density="compact" />
    </FloodRoot>
  );
}
```

## Design notes

- Use when a region has no accepted content to display and a visible label explains what is being loaded. Use Skeleton when the future content structure is known and a matching placeholder preserves its layout.
- Match the layout and density to the adjacent empty or failed states. Use actions for an actual available choice, such as cancelling an interruptible operation. The host owns cancellation and accepted data.
- The spinner is decorative. Keep announce off inside a region that already announces loading. Set announce when the visible message is the sole status region. The host marks the content region busy and owns focus throughout the request.

## API reference

| Prop | Values | Default |
| --- | --- | --- |
| `description` | `ReactNode` | `—` |
| `actions` | `ReactNode` | `—` |
| `density` | `"compact" \| "comfortable"` | `"comfortable"` |
| `layout` | `"centered" \| "inline" \| "row"` | `"centered"` |
| `label` | `string` | `Required` |
| `announce` | `boolean` | `false` |
| `Native HTML props` | `Omit<Omit<HTMLAttributes<HTMLDivElement>, "title" \| "children">, "title" \| "headingLevel" \| "icon">` | `Forwarded` |
