svelte-feather-icons icon indicating copy to clipboard operation
svelte-feather-icons copied to clipboard

Pass $$restProps onto icons?

Open quentincaffeino opened this issue 3 years ago • 4 comments

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.

quentincaffeino avatar Jul 07 '21 08:07 quentincaffeino

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

dylanblokhuis avatar Jul 07 '21 09:07 dylanblokhuis

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.

quentincaffeino avatar Jul 07 '21 10:07 quentincaffeino

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.

toddmath avatar May 06 '22 07:05 toddmath

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

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

khaki32 avatar Jun 15 '22 15:06 khaki32