8

I was wondering if the tooltip like this: tooltip from material-ui

that occurs on icon can be possible onHover of a div? Or do I have to create it by hand?

I tried this: tooltip div with reactjs

but none of the 2 solutions is currently working.

JGallardo
  • 11,074
  • 10
  • 82
  • 96
Jay Cee
  • 1,855
  • 5
  • 28
  • 48
  • 5
    Though very pretty, I've found material-ui to be limiting in a lot of ways. For arbitrary tooltips, check out https://www.npmjs.com/package/react-tooltip. – lux Mar 29 '16 at 15:31
  • Interesting, I just discovered the same library :) And I agree with you. – Jay Cee Mar 29 '16 at 15:39

1 Answers1

9

can be possible onHover of a div? Or do I have to create it by hand?

You have to create it of course. It is unclear what you mean by onHover, if you want you can use onMouseEnter and onMouseLeave to create relatively positioned tooltip.

Alternatively it is super simple to use a simple CSS tooltip : http://kushagragour.in/lab/hint/ driven by data- attributes (supported natively by react).

basarat
  • 261,912
  • 58
  • 460
  • 511
  • You perfectly answer my question :) I used the library that we were discussing with lux in commentary, but I might migrate for the solution described in your link. Thank you very much man – Jay Cee Mar 30 '16 at 08:42
  • Outstanding source for lightweight tooltips! I'd like this more than once if I could – LOTUSMS Jul 07 '17 at 21:23