jpmorganchase / salt-ds

React UI components built with a focus on accessibility, customisation and ease-of-use
https://www.saltdesignsystem.com
Apache License 2.0
111 stars 78 forks source link

Provide mechanism to load icon from its name #2982

Open origami-z opened 5 months ago

origami-z commented 5 months ago

Area

UI Components

The problem

To provide backwards compatibility from UITK icon API, custom components used to offer icon name as its prop.

The solution

It will be good to provide a way to load component from it's name, e.g. Country symbols's lazy loading

Alternatives and examples

Add additional prop to accept Icon component. However, to avoid breaking change, consumers will need to offer the name to icon mapping

Are you a JPMorgan Chase & Co. employee?

joshwooding commented 5 months ago

There's a branch with a POC https://github.com/jpmorganchase/salt-ds/tree/lazy-icon. But with the recent feedback around lazy being too slow it might need re-thinking.

origami-z commented 1 month ago

Mostly achievable with CSS name in #3092