Skip to content

Accept string type for "size" prop #16

Description

@blackwright

Hi, thank you for this library!

I'm attempting to integrate it with an existing design system and am running into a bit of an issue around the need to pass the size in rem units instead of a pixel value.

It looks like icon props currently support passing size as a number, but not a string. A string results in a type error like this:

Image

If I ignore the type error, it seems to work fine, and the value makes it to the DOM as width and height on the rendered SVG as expected:

Image

Would it be possible to update the prop typing to support this use case?

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions