Skip to main content

Component | Image

Render an image.

ui.image("https://example.com/image.png", { style: { width: "600px" } })

At this time, the image component does not support local images. You must pass a URL to an image hosted on the internet.

API reference

Function signature

ui.image(
src: string,
options: Partial<{
style: Style
}>
)

Parameters

src

required string
The URL of the image to be rendered.

properties.style

optional Style

Directly style the underlying element using CSS. See the styling guide for more details on available style properties.

For example, you can use the height and width properties to set the height and width of the image.