Tooltips WebComponents for Button

Afternoon all,

I’m in need of some tooltips for a few Icon only buttons I’ve included in my latest flow application.

I couldn’t see the v8 setDescription() method and I read in the migration documents that in V10 there is no standard way to add components. See ref below.
https://vaadin.com/docs/v10/flow/migration/5-components.html

So I assume there is no method that I’m over looking and that I’ll need to implement a tooltip myself.

I googled tooltip webcomponet and was taken straight to Polymers paper-tooltip, here.
https://www.webcomponents.org/element/PolymerElements/paper-tooltip

I was just going over the vaadin documentation on webcomponent intergration and am about to write the API but before I do I wanted to ask what the direction was for polymer elements like this. Is there an intention of creating Vaadin API’s for these standard polymer elements? Will I eventually find these in the Vaadin Directory? I can see that the webcomponent itself is listed but no V10 API yet as such. https://vaadin.com/directory/search?framework=Polymer%202&keyword=tooltip

Can I help by writing an API and posting it on the directory?

I’m looking to get something like this.

<div style="display:inline-block">
  <button>Click me!</button>
  <paper-tooltip>Tooltip text</paper-tooltip>
</div>

and for the api use it like

Div d = new Div();
Button clickMe = new Button();
PaperTooltip clickMeToolTip = new PaperToolTip("click me for heaps of extra cool information");
d.add(clickMe, clickMeToolTip);

Add:

and I wrote this last night, now today I wrote the api for it and it’s so funny how simple this is in V10. Less than 5 minutes to get up and running. Could I suggest that the documentation, below, is changed to suggest implementing the tooltip webcomponent. https://vaadin.com/docs/v10/flow/migration/5-components.html

still interested in knowing what the ideas are going forward with webcomponents. It seems like all of the standard paper components can be integrated into V10 with API’s as a standard. So we never have to leave our Java world. hehe.

Thankyou

Hayden

There are different ways to implement tooltips. The approach you have is one of them. We have issue in Flow repository about adding unified tooltip support in future versions of the platform. You can give your comments and feedback there

https://github.com/vaadin/flow/issues/4169

Thanks Tatu