tabler / tabler-icons

A set of over 5400 free MIT-licensed high-quality SVG icons for you to use in your web projects.
https://tabler.io/icons
MIT License
17.84k stars 886 forks source link

React components should append className prop #568

Open needim opened 1 year ago

needim commented 1 year ago

Hi, currently if we pass a className prop to any Icon component we are losing tabler-icon tabler-icon-${iconName} classes because it is overwriting with ...rest.

It is nice to keep them so we can define a default stroke-with via CSS.

.tabler-icon {
  stroke-width: 1.25;
}

https://github.com/tabler/tabler-icons/blob/74838ded9980b6f134bb6f7edcf916cca4a2d97f/packages/icons-react/src/createReactComponent.js#L6-L19

SyntaxJoker commented 1 year ago

Hi, thanks for submitting issue We will fix it to combine attributes correctly

needim commented 1 year ago

Thanks 👍

Rinaldo commented 7 months ago

@codecalm has there been any progress on this? Would you accept a PR?