Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ReactJS with material-ui is it possible to have the tooltip behaviour on hover of a div?

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.

like image 606
Jay Cee Avatar asked Mar 29 '16 14:03

Jay Cee


1 Answers

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).

like image 68
basarat Avatar answered Oct 20 '22 12:10

basarat