Tooltips?

Hi all,

how can I set tooltips for a component for example a button? setDescription in Vaadin 8.

I try to migrate the vaadin version of minimal-j.org to vaadin flow. There seem to be quite a lot of tiny things that have changed. Deja vu from as from 7 to 8. And 6 to 7.

regards

Bruno

Hi Bruno,

I don’t think there is yet a Java API to set a tooltip on a component, as there was in V8 with setDescription.

However it is possible by using the Element, which is available on every Component. Because a tooltip is really just a title property on the HTML element:

Button btn = new Button("Hover me");
btn.getElement().setProperty("title", "this is a tooltip");

Hi Kasper,

Good enough. Thank you very much.

There is an official Vaadin Tooltip Component but you need valid payed Vaadin License to use it.

I personally just use “CSS Tooltips” (just search online for it). It’s not perfect but in most use cases it is working fine.