Loading...
See the new new component docs (under construction) for V19 and TypeScript samples.

Image

Image

Built-in component for image element

As Image is part of Vaadin's core package it can be used without further configuration:

Image image = new Image("https://dummyimage.com/600x400/000/fff", "DummyImage");
add(image);

Using the Java API streaming resources is easy:

byte[] imageBytes = // your data source here
StreamResource resource = new StreamResource("dummyImageName.jpg", () -> new ByteArrayInputStream(imageBytes));
Image image = new Image(resource, "dummy image");
add(image);