Image

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.

Compact gradient chat icon Compact SVG chat icon

Installation

pnpm dlx shadcn-svelte@latest add http://sveltekit-prerender/r/image.json

Props

Image

PropTypeDefaultDescription
base64string-Base64-encoded image data used to build a data URL.
uint8ArrayUint8Array-Binary image data converted into an object URL.
mediaTypestring"image/png"MIME type used with `base64` or `uint8Array` input.
altstring-Required alternative text for the rendered image or placeholder.
classstring-Additional CSS classes for the image or fallback placeholder.