feathericons / react-feather

React component for Feather icons
https://npm.im/react-feather
MIT License
1.92k stars 126 forks source link

Add prop to set strokeWidth #54

Closed grubersjoe closed 4 years ago

grubersjoe commented 4 years ago

I'd like to be able to set the strokeWidth of the SVGs with a component property. This PR implements this.

pascalpp commented 4 years ago

@carmelopullara Your thoughts on this PR?

1pxone commented 4 years ago

Feature needed :)

pascalpp commented 4 years ago

if anyone is waiting on this, you can do it without the prop using the stroke-width property in CSS instead. e.g.

.my-component svg {
  stroke-width: 3;
}

(that selector will be different depending on the structure of your app.)

Julianus01 commented 4 years ago

Thanks for the workaround till then @pascalpp. Using the strokeWidth prop would be much more elegant though and everything in one place. Surprised this wasn't implemented from the get go, but happy there is a PR for it :D

mileung commented 4 years ago

I am able to use the strokeWidth prop already without this PR? "react-feather": "2.0.4"

grubersjoe commented 4 years ago

Oh boy... @MiLeung is right, all SVG properties are already supported. How did I miss this :see_no_evil: :smile:.

mileung commented 4 years ago

Although one issue I just noticed is icons with thicker stroke-widths might be cut off.

Screen Shot 2020-04-17 at 4 38 21 PM