How to set up properly logo size for header?

Hi Guys,

i am using code to add image:

Image image = new Image(“images/Logotyp_Dookoła_Pracy_KRZYWE_v2.png”,“”);
image.setWidth(200, Unit.PIXELS);
image.setHeight(200, Unit.PIXELS);
layout.add(image);

but the issue is that is looking very very strange.

How to fit image accordingly to header width and height?
image.png

How to set up properly logo size for header?

The AppLayout’s navbar (header) does not have a fixed height, but it has a default (minimum) height set to the property --lumo-size-xl. If you want to make your image scale down to that height, you can setHeight("var(--lumo-size-xl)"); and leave width unset – it will scale based on the height.

hi @useful-whale it is perfect

thank you

image.png