Rendyn

Component library

189 components

Agent UI

Image Generation

Image Generation displays the state of an image job without replacing its reserved media area. Your application supplies the job status and finished image; this component does not call an image model.

Interactive exampleReact Tailwind CSS

Practical React example

Use this wrapper for a project-cover generator. Pass status from your job API or event stream, and supply imageUrl when the result is available. The same 4:3 area remains reserved while the job is pending, complete or failed.

Before you copy and paste

Copy the ImageGeneration source and its ease, hover-capability and cn helpers from the Code tab. This is a client component. Supply your own image URL and retry handler; the example does not start a job or contact a provider.

Listed package dependencies: clsx, lucide-react, motion, react, tailwind-merge.

Use the Code tab for the component files and installation instructions, then adapt the imports in this example to your project.

Display a job state supplied by your application

'use client';

import { ImageGeneration, type ImageGenerationStatus } from '@/components/agents/image-generation';

export function ImageJob({ status, imageUrl, onRetry }: {
  status: ImageGenerationStatus;
  imageUrl?: string;
  onRetry?: () => void;
}) {
  return (
    <figure className="m-0 max-w-md">
      <ImageGeneration
        status={status}
        label="Illustration for the project cover"
        prompt="A quiet blue landscape"
        aspectRatio="4 / 3"
        size="fluid"
        onRetry={onRetry}
      >
        {imageUrl && <img src={imageUrl} alt="" width={800} height={600} />}
      </ImageGeneration>
      <figcaption className="mt-3 text-sm">Project cover illustration</figcaption>
    </figure>
  );
}

The parent owns status and imageUrl. The wrapper supplies one accessible description and uses an empty alt on the nested image to avoid repeating it. Call onRetry only through your existing authorized job flow. Set complete after a usable result is available, not merely after receiving a job identifier.

Customization

status / statusText
The imported states are queued, generating, refining, complete and error. statusText overrides the visible status. There is no cancelled state; design cancellation in the parent rather than inventing a prop value.
aspectRatio / size
aspectRatio reserves the media area. compact caps the width at 13rem; fluid fills its parent. Reserve the same ratio for the supplied image to avoid an unnecessary crop.
onRetry / showStatus
A retry button appears only in error state when onRetry exists. Keeping showStatus enabled preserves the component’s polite status announcements.

Integration notes

  • This is a presentation component. Authenticate requests, authorize access to each job, rate-limit generation and reconcile retries on the server. A retry click is not proof a provider accepted a new job.
  • The refining state can reveal a partial image; omit children until a preview is safe to show. The wrapper does not validate URLs, preload media or handle image-load errors for you.
  • The pinned source uses reduced-motion preferences for its animation. Test status changes with assistive technology and keep descriptive text useful when the canvas effect is absent.

Component source: beUI documentation . These examples describe the version imported into Rendyn. Upstream APIs may have changed; retain the source licence notices when adapting the code.

Better with your agent

Give your agent taste.

The best way to use Rendyn is through MCP. Let your agent find the right component, compare previews and bring the source into your project.

All components are free. Sign up only to connect MCP.

Connect to MCP