Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to specify SVG title #158

Open
sylvainpolletvillard opened this issue Feb 1, 2022 · 4 comments
Open

Ability to specify SVG title #158

sylvainpolletvillard opened this issue Feb 1, 2022 · 4 comments

Comments

@sylvainpolletvillard
Copy link

Hello, and thanks for this great library.

I would like to add a title attribute to my icon components.
Problem is <svg title="Icon explaination"></svg> does not provide a tooltip on mouseover as you would expect with any other HTML element. For SVG, the title must be a child element of the svg tag like this:

<svg xmlns="http://www.w3.org/2000/svg">
  <title>icon explaination</title>
</svg>

which is out of reach at the moment with unplugin-icons

I wonder if it would be possible from unplugin-icons to support a title prop for Icon components that would add this <title> element as a child to SVG elements injected. Open to other suggestions as well. Thanks !

@userquin
Copy link
Member

userquin commented Feb 2, 2022

@userquin
Copy link
Member

@sylvainpolletvillard working on adding i18n support new feature, stay turned... ;)

@userquin
Copy link
Member

I need to fix a few things, but it works, on mouse over the title will appear as a tootip:

imagen

imagen

@CanRau
Copy link

CanRau commented Dec 2, 2024

any news on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants