[icons-react] Use a size prop, don’t export 4 bespoke sprites/components per icon #5170
Labels
proposal: open
This request has gone through triaging. We're determining whether we take this on or not.
role: dev 🤖
type: enhancement 💡
Looking to add copy + paste react code to the website icon library. We want avoid giving a hard-coded size (
<Add32 />
).A generic
<Add size='sm/md/lg/xl' />
component would make for a much better candidate for copy+paste. The current API makes it hard to know what sizes are available, users are more likely to have a failed import than a prop-type failure.I think our initial implementation of this package was beholden to the idea that we’d come up with hand tuned, bespoke icon assets at each size. This isn’t scaleable and results in idiosyncrasies when components are used together. (Example + and -).
By simply reducing the
width
of the32
px svg and scaling down, we'd be able to accomodate all 4 sizes with a single component.The text was updated successfully, but these errors were encountered: