Use providers to define component icons #179
fynnfeldpausch
started this conversation in
Ideas
Replies: 1 comment
-
Sounds like this could just be polymorpheus content with size being $implicit of context. I'll investigate this idea next week. We already use similar approach to auto rotate arrow icon in drop-down components like combo box or select. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey, this is just a follow up discussion of todays Q&A session.
The current way to customize icons seems like a quick fix to me without a good concept. The mapping described at https://taiga-ui.dev/icon-set has a couple of drawbacks in my opinion:
I thought it could be nice to use the providers suggested in #139 to also define icons for that component. the provider could define the icon and even use a function that takes the height of the component as an argument. That way one could either define a single icon name or even different icon names for different sizes. That is much more flexible. Imagine that one of the components switches to another of your icons if the components is used with size
xs
. But what if we also want to change if it used withxl
. This is currently not possible.Here is a rough outline of what I mean:
In the component one would check if the dateOptions icon is a function. Then call it with the current size of the component or use the string name directly.
Beta Was this translation helpful? Give feedback.
All reactions