Skip to content

Function: image()

ts
function image(props: UiImageProps): Element;

Defined in: src/UI/blocks/image.tsx:50

Image viewer component for displaying and interacting with images.

Parameters

ParameterTypeDescription
propsUiImagePropsConfiguration object

Returns

Element

Examples

Basic usage with static image

image({
  src: 'data:image/png;base64,iVBORw0KGgoAAAANSU...',
  filename: 'screenshot.png'
});

Usage with dynamic image from params with data and value

image({
  src: ({data}) => data.currentDocument.imageData,
  filename: ({data}) => `${data.currentDocument.name}.${data.currentDocument.extension}`,
  errorMessage: ({data}) => `Failed to load ${data.currentDocument.name}`
});

Usage with custom settings and messages

image({
  src: 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEA...',
  filename: 'report.jpg',
  debounceMs: 500,
  loadingMessage: 'Processing image...',
  errorMessage: 'Image could not be displayed',
  id: 'main-image-viewer'
});

Matterway Assistant SDK Documentation