Slate button widget tooltip

82 Views Asked by At

I have added a button in the slate application. When the user hovers over the button, a tooltip should pop out. I am using a slate button widget.

1

There are 1 best solutions below

0
ZettaP On

You can use a clickable widget instead and create a button in it: https://www.palantir.com/docs/foundry/slate/widgets-text/#text

Set the clickable to markdown mode and turn on "Tooltips enabled".

The content of the div can be:

<sl-tooltip>
    <button slClickEvent="event" class="pt-button pt-intent-primary">Click Me!</button>
</sl-tooltip>

And will render as:

enter image description here

The event of the clickable can then be wired to what you want/need, like a toast:

enter image description here