Let users pass through 'slots' for custom icons
Closed this issue · 3 comments
Hey paji, I really like what you have done with this set of components,
But I was thinking it might be a bit better for the DX
if we could pass in as a slot another Icon that they would like to use or even leverage astro-icon
in the background to then let users just pass in via prop the name of the icon they want to consume.
This is a great component, I really do like how you have composed this.
astro-navbar/src/components/MenuIcon.astro
Lines 9 to 28 in dd75d2d
Great idea. I should also add a logic here to support close icon as well. As you can see its bit clever here 😀
Maybe something like this. Default can be empty to use the current one.
<MenuIcons>
<OpenIcon><svg/></OpenIcon>
<CloseIcon><svg/></CloseIcon>
</MenuIcons>
Aye that would be alot better for the DX
Done :)