natemoo-re / astro-icon

Inline and sprite-based SVGs in Astro made easy!
https://astroicon.dev
Other
1.08k stars 60 forks source link

Add `title` inside `svg` to improve accessibility #36

Closed ownchoice closed 2 years ago

ownchoice commented 2 years ago

I think it would be nice to be able to add a title tag inside the svg of the icon, for accessibility purposes.

<svg role="img"><title>Good Label</title> ... </svg>.

For reference: Accessible SVG Icons | CSS-Tricks

m4rrc0 commented 2 years ago

I was just looking for the exact same thing and discovered there is a title prop for that. 🤩 See Props.ts for all the props available.

ownchoice commented 2 years ago

Oh, you're right. That does the trick, thanks!