https://kotlinlang.org logo
#compose
Title
# compose
a

Alexander Maryanovsky

12/10/2023, 7:12 PM
I find
TooltipArea
to be cumbersome and would like to implement a
Modifier.tooltip(String)
for when I just want to add a simple textual tooltip to an element. But I can’t just write
Box
in a modifier. How would I go about implementing this?
1
👀 1
g

Greg Steckman

12/10/2023, 11:03 PM
Take a look at
HoverableElementArea
here. Is that something like what you are looking for? Doesn't really do much on Android since there is no mouse pointer but it works on Desktop and web.
b

brandonmcansh

12/11/2023, 2:04 PM
Working on this actually (not directly M.tooltip(String) but close )👀
a

Alexander Maryanovsky

12/11/2023, 2:07 PM
Hmm, interesting idea. I could put a
TooltipHost
somewhere high in the hierarchy, and
Modifier.tooltip
could communicate with it.
1