ui
ui copied to clipboard
Add color prop to UIcon
Description
Looking at Iconify I see that it supports colors for
I would love to add it myself with some guidance, or pass this onto someone who knows more
Additional context
No response
I now found an issue from last year about this. Personally it seems like a color prop here would be better than adding a tailwind class but is there a reason it hasn't been added?
I believe Icons are not plain components that depend on a tailwind palette. They will just take the currentColor
to fill the icon's SVG. Basically, any svg whose path's fill
property is currentColor
will take the color the surrounding text is supposed to have. So if you want to apply the color blue-500
, just put class="text-blue-500"
on your Icon