Jay Cee
Jay Cee

Reputation: 1965

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.

Upvotes: 8

Views: 11294

Answers (1)

basarat
basarat

Reputation: 276343

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

Upvotes: 9

Related Questions