tabler / tabler-icons

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

Option to remove width and height and rely on viewBox for auto-scaling #786

Open dorshinar opened 1 year ago

dorshinar commented 1 year ago

Hi :)

All icons in tabler have a predefined width and height that can be overriden by passing a prop. This means that by default they don't scale with their container I was wondering if you would consider exporting the icons with width and height removed as well (on top of the regular icons), so that we can rely on flexbox and grid to define the size of the icons.

Out main use case is creating reusable component with predefined sizes that can accept icons from the consumer, like a button:

<Button icon={<Icon123 />} />

Right now to make it work the consumer of out <Button /> component must pass the correct size to the <Icon123 /> component, but ideally that's something we would like to take care of inside the <Button /> component with css sizing.

Phillip2025 commented 11 months ago

Hi!

Currently I'm facing the same issue on React: If I want to just let the user to decide the icon, but not the size or the stroke, how would I define these defaults at component level?