{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "image",
  "title": "Image",
  "author": "Jamie Thompson <jamie@jamiethompson.design> (https://jamiethompson.design)",
  "description": "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.",
  "dependencies": [
    "ai@^7",
    "cn"
  ],
  "registryDependencies": [],
  "files": [
    {
      "path": "registry/ai/image.tsx",
      "content": "// Derived from Vercel AI Elements image.tsx (Apache-2.0, Copyright 2023 Vercel, Inc.).\n// Modified for uifiles: ported from Radix UI to Base UI; dependencies point at @uifiles.\n\nimport type { GeneratedFile } from \"ai\"\nimport { cn } from \"cn\"\n\nexport type ImageProps = GeneratedFile & {\n  className?: string | undefined\n  /** Text alternative for the generated image; pass \"\" only when it is decorative. */\n  alt: string\n}\n\nexport const Image = ({\n  base64,\n  uint8Array: _uint8Array,\n  mediaType,\n  providerMetadata: _providerMetadata,\n  alt,\n  className,\n  ...props\n}: ImageProps) =>\n  base64 ? (\n    // biome-ignore lint/performance/noImgElement: the source is an inline data: URL from the model, which next/image cannot optimize\n    <img\n      {...props}\n      alt={alt}\n      className={cn(\"h-auto max-w-full overflow-hidden rounded-md\", className)}\n      src={`data:${mediaType || \"image/png\"};base64,${base64}`}\n    />\n  ) : null\n",
      "type": "registry:component",
      "target": "components/ai/image.tsx"
    }
  ],
  "docs": "Derived from Vercel AI Elements (Apache-2.0, Copyright 2023 Vercel, Inc.); ported to Base UI and maintained by uifiles. Built for the Base UI styles (base-nova); the file imports no style wrappers, so nothing in it is style-specific. ImageProps extends `GeneratedFile` from ai@7 (Experimental_GeneratedImage is a deprecated alias slated for removal in v8; the shape is identical) and, unlike upstream, requires `alt` (pass \"\" only for a decorative image). base64 and mediaType become the data: src; uint8Array and providerMetadata are stripped, so only alt, className and src reach the <img>. A missing mediaType falls back to image/png (browsers sniff the real format); missing base64 renders nothing. Spread plain objects only: a DefaultGeneratedFile instance exposes base64 through a prototype getter that object spread does not copy, so pass base64/mediaType/uint8Array explicitly. Uses a plain <img> (biome noImgElement suppressed) because the source is an inline data: URL.",
  "categories": [
    "ai",
    "chat",
    "media"
  ],
  "type": "registry:component"
}