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

Pass $$restProps onto icons? #14

Open
quentincaffeino opened this issue Jul 7, 2021 · 4 comments
Open

Pass $$restProps onto icons? #14

quentincaffeino opened this issue Jul 7, 2021 · 4 comments

Comments

@quentincaffeino
Copy link

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
Copy link
Owner

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

@quentincaffeino
Copy link
Author

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
Copy link

toddmath commented May 6, 2022

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
Copy link

khaki32 commented Jun 15, 2022

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

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

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

4 participants