# Image Generation

> Generated image surface from queued work to a finished result.

Registry name: `image-generation`. HTML docs: https://ui.anuragroy.dev/component/image-generation.

## Install

```bash
npx shadcn@latest add https://ui.anuragroy.dev/r/image-generation.json
```

If the website is down: `npx shadcn@latest add https://raw.githubusercontent.com/anurag-roy/ui.anuragroy.dev/main/public/r/image-generation.json`.

Registry JSON: https://ui.anuragroy.dev/r/image-generation.json (GitHub: https://raw.githubusercontent.com/anurag-roy/ui.anuragroy.dev/main/public/r/image-generation.json).

## Import

Import paths follow the consumer `components.json` aliases. After a default install:

```tsx
import {
  ImageGeneration,
  ImageGenerationActions,
  ImageGenerationLabel,
  ImageGenerationMedia
} from "@/components/ui/image-generation"
```

## Usage

```tsx
import {
  ImageGeneration,
  ImageGenerationLabel,
  ImageGenerationMedia,
} from "@/components/ui/image-generation"

export function Example() {
  return (
    <ImageGeneration state="done">
      <ImageGenerationMedia>
        <img src="/result.png" alt="Generated image" />
      </ImageGenerationMedia>
      <ImageGenerationLabel>Done</ImageGenerationLabel>
    </ImageGeneration>
  )
}
```

## API

### ImageGeneration

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `state` | "queued" \| "generating" \| "refining" \| "done" \| "error" | "done" |  |

## See also

- [HTML page](https://ui.anuragroy.dev/component/image-generation): Preview and the same docs in the site chrome.
- [Registry item](https://ui.anuragroy.dev/r/image-generation.json): Source files and dependencies.
- [Catalog](https://ui.anuragroy.dev/component): All components.
- [llms.txt](https://ui.anuragroy.dev/llms.txt): Agent index for this library.
