Tooltip / help hover on single words in text

Is it possible to make a help hover / tooltip for single words in a paragraph? For example:

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.

The bold words should represent acronyms that should have a hover / tooltip explaining these acronyms like GIF - hover over word shows “Graphics Interchange Format”

That’s not possible with native streamlit text display, unfortunately, and I don’t know if there’s a component to allow that. You can add a hover/tooltip on a single entry, like this, but not on an individual word in the middle of a paragraph.

There is something that’s somewhat similar https://st-annotated-text.streamlit.app/ that you could use, but that would always show the definitions, not just on hover.

Thanks for your reply! Maybe this could be added as a feature in the future.

I used annotated text for something else before but had errors accuring after the latest streamlit update, so I removed it.

I just released a new version of st-annotated-text that fixed at least one issue that was reported, and it seemed to work fine for me now on a fresh installation with the latest streamlit. If you run into issues again, would you mind adding an issue on github GitHub · Where software is built?

1 Like