DEV Community

Discussion on: Build your own React Tooltip Component

Collapse
 
yoursunny profile image
Junxiao Shi

It's a lot easier to use the HTML title attribute:

<button title="view details">details</button>
Enter fullscreen mode Exit fullscreen mode
Collapse
 
alexandprivate profile image
Alex Suarez • Edited

Hi there, LOL, easier? Sure. Better? Absolutely not, you can style title, not ui or behaviour, also title has a default delay to show up, we can say title is the most primitive way of tooltip natively support by the browser, so if you can improve that do it 👍