tabler / tabler-icons

A set of over 5700 free MIT-licensed high-quality SVG icons for you to use in your web projects.
https://tabler.io/icons
MIT License
18.31k stars 917 forks source link

[Feature request] Turn title attribute/prop into title tag child inside svg #1139

Closed sebastienbarre closed 5 months ago

sebastienbarre commented 5 months ago

Howdy. I recently moved from React Icons to Tabler Icons for React, because of your high quality icons and more frequent updates. Great project so far.

Something I just noticed is that my title attributes are no longer showing up. In other words, moving my cursor over this Tabler icon <IconArrowLeft title="Back to this item"/> does not show the title attribute as a small popup over the icon.

After some digging, I found out that the title attribute is indeed NOT supported on the SVG parent tag. What is supported (and recommended) is to use a <title>Back to this item</title> tag inside the SVG parent tag.

This is indeed what React Icons has been doing since 2019 on our behalf:

Essentially the title prop is intercepted, and injected before the React children:

      {title && <title>{title}</title>}
      {props.children}
   </svg>

Is this something you would consider adding to Tabler Icon?

Thank you very much.