mveytsman / heroicons_elixir

Phoenix components for Heroicons! 🛡️
MIT License
118 stars 28 forks source link

Add <title> or <text> Tags to SVG, for Accessibility #38

Open WammKD opened 3 months ago

WammKD commented 3 months ago

I may've just missed how to do so but is there a way to add these as HTML tags to the SVG? title attributes aren't recognized by screen readers and the recommended method for accessible icons is to put a <title> or <text> tag within the SVG.

It'd be super useful to be able to do something like <Heroicons.gear solid title="A gear" /> and <title>A gear</title> would show up within the rendered SVG.

Attributes such as aria-label aren't a problem as they can, already, be added like any other attribute.

mveytsman commented 3 weeks ago

Oooh, TIL

This would be great - I'd welcome a PR for it, but don't have the availability to add it myself.