# ImageFigure

Responsive imagery with a caption and a visible failure state.

- Family: Content, imported from `mizu-ui` or `mizu-ui/content`
- Docs: https://mizu.user64bit.world/components/image-figure
- Source: https://github.com/0xuser64bit/mizu/blob/main/packages/mizu/src/content/Media.tsx

## Usage

```tsx
import { ImageFigure } from "mizu-ui";

export function Example() {
  const field = (ground: string, mark: string) =>
    `data:image/svg+xml,${encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg" width="720" height="360"><pattern id="d" width="36" height="36" patternUnits="userSpaceOnUse"><path d="M18 13l5 5-5 5-5-5z" fill="${mark}"/></pattern><rect width="720" height="360" fill="${ground}"/><rect width="720" height="360" fill="url(#d)"/></svg>`)}`;
  return (
    <ImageFigure
      src={field("#141413", "#7e776b")}
      alt="Warm diamonds arranged on a dark measurement field"
      caption="Field study 01 — a repeatable spacing rhythm."
      width={720}
      height={360}
    />
  );
}
```

## Copy it with the shadcn CLI

```sh
npx shadcn@latest init 0xuser64bit/mizu/preset # once, where there is no components.json
npx shadcn@latest add 0xuser64bit/mizu/image-figure
```

## Props

- `src / alt`: `string`. Resource URL and meaningful image description.
- `caption`: `ReactNode`. Optional visible context.
- `...props`: `ImgHTMLAttributes`. Native image attributes, including dimensions and srcSet.

## Accessibility

Native figure/image/caption; lazy by default. Supply dimensions to prevent shifts. Failed images retain the description.

## Motion

Static media.
