Skip to content
caliper ui pro docs

Image generation

A card that shows an image as it is generated, from queued to complete.

Pro
Illustration of a sailboat in a quiet harbour

A quiet harbour at dusk, flat shapes, muted teal and clay

Image ready

When to use

  • An assistant produces images and the wait should feel alive.
  • You need retry and download actions on the result.

When not to use

  • The image already exists and only needs viewing; use the image viewer.

Installation

terminal
pnpm dlx shadcn@latest add @caliper/image-generation

Adds its 4 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.

API reference

ImageGeneration

12 props
PropTypeDefaultDescription
prompt *string—
status *GenerationStatus—
srcstring—
altstring—Describe the picture for people who cannot see it.
progressnumber—0 to 1 when known; omit for an indeterminate wait.
stagestring—What it is doing now, such as "Adding detail".
aspectRatiostring"4 / 3"
errorTextstring"The image could not be made. Nothing was charged."
onRetry(() => void)—
onCancel(() => void)—
actionsReactNode—Buttons under a finished image, such as Download or Vary.
classNamestring—

Keyboard

  • No custom key handling; Tab and the native activation keys do the work.

Accessibility

It exposes progressbar, alert and status semantics, with aria-busy, aria-hidden, aria-label, aria-valuemin, aria-valuemax and aria-valuenow kept in step with state. Changes that matter are announced through a live region.

Notes for AI

Give your coding assistant this page as Markdown instead of screenshots: the props, keyboard and examples in one file.

/docs/components/image-generation.md

The index of every part is at /llms.txt.

More in Agent media