☰Read-only archive⌕
Looking for help with Bokeh?

This is a read-only archive. Ask questions and join the conversation on GitHub.

Visit Community Support on GitHub →
Archived discussions · Captured October 28, 2026

Hover Tooltip for Button

Community Supportbokeh
monade
monade

I’m trying to implement a tooltip for a Button which is only visible when the user hovers over the button. Something like this seems to be supported with the target attribute of the ToolTip model, which allows applying tooltips to arbitrary widgets.

Here is a minimal example:

from bokeh.document import Document
from bokeh.embed import file_html
from bokeh.models import Button, Tooltip
from bokeh.resources import INLINE
from bokeh.util.browser import view

button = Button(label='Hello world')
tooltip = Tooltip(content='My Tooltip', position='right', visible=True, target=button)

doc = Document()
doc.add_root(button)
doc.add_root(tooltip)

with open('test.html', 'w') as f:
    f.write(file_html(doc, INLINE, 'Hello world'))
view('test.html')

However, the tooltip seems to be always visible and I couldn’t find a way to make it only appear when the user hovers over the button (which is my understanding of what a “tool tip” typically is). Is this possible?

⌁   Link to post

End of archived discussion · Replies are disabled