dylanblokhuis / svelte-feather-icons

https://www.npmjs.com/package/svelte-feather-icons/
MIT License
136 stars 21 forks source link

Pass $$restProps onto icons? #14

Open quentincaffeino opened 3 years ago

quentincaffeino commented 3 years ago

I wanted to add a title to icon but couldn't since props weren't passed. Can open a pr if this feature is welcome.

dylanblokhuis commented 3 years ago

Adding this feature also requires to add all the types for svg elements, is there an interface available from svelte's internals?

quentincaffeino commented 3 years ago

Not sure I understand you correctly but I don't think svelte defines types for dom elements. You can use typescript type for that see

Also I'm not sure you if you need to define those since $$restProps is used inside the component, however it would be a good addition.

toddmath commented 2 years ago

I also would like to set a title on an svg for accesibility. The SVG 1.1 specification specifically mentions the importance of providing a title for the element.

khaki32 commented 2 years ago

As a workaound, you can create a wrapper for the icon:

<div style="display: contents" title="The icon title">
  <PlusIcon />
</div>