You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Question: How would you make the sample tab component to use svg icons instead of font icons #715
@VictorGaiva The slot doesn't propagate to Tab because the TabItem is considered a slot itself. TabItem would have access to icon slot but not Tab. This doesn't work very well when you have to conditional rendering as Tab is doing, seems like one way is passing attributes back to TabItem to generate a button and then one to generate its contents. The whole logic then shifts to TabItem
I would consider the approach taken with new phx generated CoreComponents.icon/1, which embeds the svg into css, and makes it trivial to use as if it was a font based icon.
Activity
VictorGaiva commentedon Nov 6, 2023
I believe that 'icon' should've been a
slot, instead of just:string.deviprsd commentedon Nov 7, 2023
@VictorGaiva The slot doesn't propagate to
Tabbecause theTabItemis considered a slot itself.TabItemwould have access toiconslot but notTab. This doesn't work very well when you have to conditional rendering asTabis doing, seems like one way is passing attributes back toTabItemto generate a button and then one to generate its contents. The whole logic then shifts toTabItemdougw-bc commentedon Nov 7, 2023
I would consider the approach taken with new phx generated
CoreComponents.icon/1, which embeds the svg into css, and makes it trivial to use as if it was a font based icon.deviprsd commentedon Nov 10, 2023
@dougw-bc I ended up that route, now I just want to see if something like this should be possible 😄