Skip to content
uifiles
Browse components
MediaComponent

Image

Renders an AI-generated image (base64 plus media type from the AI SDK GeneratedFile / experimental_generateImage result) as a responsive, rounded <img> with a data: URL. Use it to display model-generated images in chat messages; alt is required and className passes through.

pnpm dlx shadcn@latest add @uifiles/image

Generated image

A base64 payload and its media type from the AI SDK, rendered as a data URL at the width of its container.

A stylized sunset over mountains

Constrained width

The same image with a width class; the height follows.

The same image constrained to 240px wide