Icon

The Icon component allows you to display an icon. You can use icons from Vaadin icons or any other set.

Using Icon

Icon is normally used with the default VaadinIcon enumeration which maps all the icons from vaadin-icons.

Example: Creating a Vaadin logo icon.

Icon icon = VaadinIcon.VAADIN_H.create();
new Button("Vaadin", icon);

You can also use an Icon from another collection.

Example: Creating a "clock" icon from the vaadin-lumo-styles collection.

Icon icon = new Icon("lumo", "clock");
new Button("Clock", icon);