Image¶
marimo.image
¶
image(
src: ImageLike,
alt: Optional[str] = None,
width: Optional[Union[int, str]] = None,
height: Optional[Union[int, str]] = None,
rounded: bool = False,
style: Optional[dict[str, Any]] = None,
caption: Optional[str] = None,
) -> Html
Render an image as HTML.
Examples:
# Render an image from a URL
mo.image(
src="https://marimo.io/logo.png",
alt="Marimo logo",
width=100,
height=100,
rounded=True,
caption="Marimo logo",
)
PARAMETER | DESCRIPTION |
---|---|
src
|
a path or URL to an image, a file-like object (opened in binary mode), or array-like object.
TYPE:
|
alt
|
the alt text of the image
TYPE:
|
width
|
the width of the image in pixels or a string with units
TYPE:
|
height
|
the height of the image in pixels or a string with units
TYPE:
|
rounded
|
whether to round the corners of the image
TYPE:
|
style
|
a dictionary of CSS styles to apply to the image
TYPE:
|
caption
|
the caption of the image
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Html
|
|