Skip to content

Image

Displays an image from a URL or a Base64 data URI.

new Image("https://example.com/logo.png")
PropertyTypeDefaultDescription
srcStringImage URL or data:image/...;base64,... data URI
styleString""Inline CSS — use to control width, height, border-radius, etc.
cssClassesString""CSS class names
new Image("https://picsum.photos/200/300")
Image.builder()
.src("https://example.com/product.jpg")
.style("width: 200px; height: 150px; object-fit: cover;")
.build()
Image.builder()
.src("https://example.com/user.jpg")
.style("width: 64px; height: 64px; border-radius: 50%;")
.build()
Image.builder()
.src("data:image/png;base64,iVBORw0KGgoAAAA...")
.build()
Card.builder()
.title(new Text("Product"))
.media(new Image("https://example.com/product.jpg"))
.variants(List.of(CardVariant.stretchMedia))
.build()