# Avatar

A stable identity image with initials or an explicit text fallback.

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

export function Example() {
  return (
    <FloodRoot>
      <Avatar name="Alex Morgan" />
    </FloodRoot>
  );
}
```

## Design notes

- Name supplies the accessible image name; decorative suppresses duplicate naming next to an equivalent visible name.
- Fallback remains visible until the image loads and after a load error. Changing src starts a fresh load lifecycle.
- Native span props and ref target the root. Size and shape do not change during loading. Available in 0.2.4.

## API reference

| Prop | Values | Default |
| --- | --- | --- |
| `name` | `string` | `Required` |
| `src` | `string` | `—` |
| `fallback` | `string` | `—` |
| `size` | `"sm" \| "md" \| "lg"` | `"md"` |
| `shape` | `"circle" \| "rounded"` | `"circle"` |
| `decorative` | `boolean` | `false` |
| `Native HTML props` | `Omit<HTMLAttributes<HTMLSpanElement>, "children" \| "role" \| "aria-label" \| "aria-hidden">` | `Forwarded` |
