feathericons / elm-feather

Feather icons for elm
http://package.elm-lang.org/packages/1602/elm-feather/latest
BSD 3-Clause "New" or "Revised" License
77 stars 4 forks source link

Expose a dictionary from name to an icon #12

Closed tad-lispy closed 5 years ago

tad-lispy commented 5 years ago

It would be nice to have a way of getting an icon dynamically (e.g. from the user input). Perhaps the module could expose a dictionary of String to Icon, to be used like this:

Dict.get "activity" FeatherIcons.icons

My use case is parsing and rendering an Elm Markup document loaded via HTTP. Inside I have a custom element called icon that takes a name parameter:

Look { icon | arrow-up }, it's up there!

I'd like to provide a dictionary of icons to the parse function, so it would be easy to select the icons I need and add custom ones.

1602 commented 5 years ago

Thanks for this request. I think it makes sense to expose this API. I drafted a pull request #13, let me know if it suits your needs and I will release it (ideally if you try it out in your project before this new API published).