carloskiki / leptos-icons

An icon library for the leptos web framework
MIT License
95 stars 22 forks source link

What is the type of Icon & icondata? #44

Closed s1n7ax closed 9 months ago

s1n7ax commented 9 months ago

I'm new to rust but it seems icon type is not exposed. My requirement is to store a list of icons in an array and use a loop to show all of them. But I couldn't get it working because the icondata_core::IconData type is not exposed from the lib. Is it possible to store a list of either leptos_icons::Icons or icondata_core::IconData? If so what would be the type of the array?

carloskiki commented 9 months ago

You should be able to use the Icon type Alias. Basically Icon is a reference to a IconData, which is what you want. Every Icon is has the Icon type (you can see it as a pointer to the data).

s1n7ax commented 9 months ago

Thanks! icondata::Icon works.