The Image component displays images from base64 or Uint8Array data, supporting all standard HTML image attributes. It is ideal for showing AI-generated images or user uploads in chat and AI apps. Compatible with AI SDK v5 architecture.
Installation
Copy the Source Code
Copy and paste the following code into your project:
Props
Image
| Prop | Type | Default | Description |
|---|---|---|---|
base64 | string | - | Base64-encoded image data used to build a data URL. |
uint8Array | Uint8Array | - | Binary image data converted into an object URL. |
mediaType | string | "image/png" | MIME type used with `base64` or `uint8Array` input. |
alt | string | - | Required alternative text for the rendered image or placeholder. |
class | string | - | Additional CSS classes for the image or fallback placeholder. |