Skip to content
caliper ui docs

Pro

Image generation

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

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

Harbour Days newsletter

Cover art requested by Mara Chen · due Friday, 6 November

Illustration of a sailboat in a quiet harbour

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

Image ready

Installs components/ui/image-generation.tsxDepends on @radix-ui/react-slot, lucide-reactMotion none in component source

When to use

Use it for

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

Skip it when

  • 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.

Usage

Import it from your copy of the source. The example behind the preview comes with the source.

example.tsx
import { ImageGeneration } from "@/components/ui/image-generation"

The worked example comes with Pro

The 78-line example behind the preview opens here, ready to copy.

  • 626 Pro parts, blocks and page templates, all with source
  • $149 once, with lifetime updates. No renewal
  • A full refund within 14 days if it is not for you
Checking your licence…

API reference

ImageGeneration

component
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—

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.

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

Motion

It declares no animation in its component source. Any transition comes from its stylesheet, which uses the duration tokens that collapse to instant under prefers-reduced-motion.

All Agent media examples