It's almost 2025, so it's time to stop using the title attribute everywhere. Images, text, buttons, ... you name it, devs really like to put it on any

PSA: Stop using the title attribute as tooltip!

submited by
Style Pass
2024-12-24 04:00:06

It's almost 2025, so it's time to stop using the title attribute everywhere. Images, text, buttons, ... you name it, devs really like to put it on any element in sight. Most of the time, people actually want to create a tooltip. You know, that little bubble of information designed to clarify the purpose of otherwise unclear elements, that pops up attached to an element when its receives focus or a user hovers their mouse over it.

The identifying thing about tooltips is that they contain no interactive elements (aka. only plain text), and are always attached to existing interactive elements. Whenever you want to add interactive elements inside your information bubble, it's not called tooltip, but toggletip. Toggletips can contain semantic markup, rich content and interactive elements, and usually only appear when an element is clicked. The great thing about toggletips is that they're accessible on touchscreens and easier to find and recognise for users with low vision.

But let's circle back to the title attribute. Often, people use it to create a tooltip. However, this is not the recommended way to go.

Leave a Comment