Image
Displays AI-generated images from the AI SDK.
The Image component displays AI-generated images from the AI SDK. It accepts a Experimental_GeneratedImage object from the AI SDK's generateImage function and automatically renders it as an image.
Install using CLI
Install Manually
Copy and paste the following files into the same folder.
Usage with AI SDK
Build a simple code generation tool using the experimental_useObject hook.
Add the following component to your frontend:
Add the following route to your backend:
Features
- Accepts
Experimental_GeneratedImageobjects directly from the AI SDK - Automatically creates proper data URLs from base64-encoded image data
- Supports all standard HTML image attributes
- Responsive by default with
max-w-full h-autostyling - Customizable with additional CSS classes
- Includes proper TypeScript types for AI SDK compatibility
Props
<Image />
altstring
classstring
<img> element. [...props]Experimental_GeneratedImage