feathericons / elm-feather

Feather icons for elm

Home Page:http://package.elm-lang.org/packages/1602/elm-feather/latest

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Expose a dictionary from name to an icon

tad-lispy opened this issue · comments

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.

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).