Axon 911 Frontend DocsAxon 911 Frontend Docs
Axon 911 Frontend Docs
    Loading navigation…
U
User
Switch to light mode
  1. Components
  2. Generated Image
  3. API and Development

Generated Image

API and Development

View SourceOpens in a new tabSubmit IssueOpens in a new tab
Import GeneratedImage from @prepared911/ui/generated-image. Props are a union: meaningful with alt, or decorative.
PropTypeDefaultNotes
altLocalizedMessagerequired unless decorativeAccessible description
decorativetrueEmpty alt, aria-hidden; alt is then not allowed
urlstringWins over base64 when not empty
base64stringData without the data: prefix
mediaTypestringimage/pngMust be an image/* type. Case, surrounding whitespace and parameters (;charset=…, ;base64) are dropped
classNamestringAppended to the frame
refRef<HTMLDivElement>The frame
data-* attributes pass to the frame. Reserved design-system state names are dropped with a warning.
Exports
GeneratedImage and the type GeneratedImageProps.
Props
NameTypeDefaultDescription
altLocalizedMessage—Accessible description of the picture. A decorative image has no description.
base64string—Base64-encoded image data, as an AI SDK file part carries it. Used when url is empty.
classNamestring—Classes appended after the generated classes, on the frame that clips and rounds the picture.
decorativeboolean—The image is meaningful: omit it or pass false. Marks the picture decorative: an empty alt, hidden from assistive technology.
mediaTypestring"image/png"MIME type of the base64 data. Case, whitespace and parameters are dropped. It must be an image type: Image rejects any other data: URL in development.
refRef<HTMLDivElement>—Ref to the frame element.
urlstring—Image URL. It wins over base64 when it is not empty.
Storybook
Interactive examples and edge cases for this component are in Storybook.
DefaultOpens in a new tab
Previous
Generated Image / Usage
Next
Generated Image / Accessibility
On this page
Exports
Props
Storybook