Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add usage example #3

Closed
malaire opened this issue Oct 18, 2020 · 6 comments
Closed

Add usage example #3

malaire opened this issue Oct 18, 2020 · 6 comments

Comments

@malaire
Copy link

malaire commented Oct 18, 2020

Add an example of how to use Icon within Html.

@icidasset
Copy link
Owner

Hey, thanks for making an issue!

There's an example in the README.
But I assume you saw that, so I guess it's not clear that Filled.offline_bolt can be used in Html? 🤔
I'll add some type signatures to the example soon.

@icidasset
Copy link
Owner

Made code comment in readme slightly better.

@dbrgn
Copy link

dbrgn commented Dec 10, 2022

For the record (since I was a bit confused as well):

Icon msg is an alias for Svg msg.

To convert a Svg msg to a Html msg, use the svg function: https://package.elm-lang.org/packages/elm/svg/latest/Svg#svg

@dbrgn
Copy link

dbrgn commented Dec 10, 2022

Oops, that's actually wrong, you can us an Icon msg directly just like a Html msg!

(The reason why this initially didn't work for me was that I'm using Html.Styled.Html by default, so I had to pass the icon through fromUnstyled first.)

@icidasset
Copy link
Owner

Yeah, it's an alias for: Int -> Coloring -> Svg msg

I didn't want to make an alias, but I had to because of Elm's limitation on the size of docs.json file 🙈
And yeah exactly, you can just use it together with Html msg

@dbrgn
Copy link

dbrgn commented Dec 10, 2022

Anyways, thanks @icidasset for the lib, once I figured out how, it was quite convenient to use!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants