Image¶
- marimo.image(src: str | bytes | BytesIO | BufferedReader | Any, alt: str | None = None, width: int | None = None, height: int | None = None, rounded: bool = False, style: dict[str, Any] | None = None, caption: str | None = None) Html ¶
Render an image as HTML.
Examples.
# Render an image from a local file mo.image(src="path/to/image.png")
# 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", )
Args.
src
: a path or URL to an image, a file-like object (opened in binary mode), or array-like object.alt
: the alt text of the imagewidth
: the width of the image in pixelsheight
: the height of the image in pixelsrounded
: whether to round the corners of the imagestyle
: a dictionary of CSS styles to apply to the imagecaption
: the caption of the image
Returns.
Html
object