AustinGil / vuetensils

🍴 A tasty toolset for Vue.js 🛠 - Lightweight, functional components to boost your next project.
https://vuetensils.austingil.com/
MIT License
658 stars 38 forks source link

[Feature Request] Markup support in tab labels #114

Closed patrickcate closed 3 years ago

patrickcate commented 4 years ago

I think a good addition for the tab component would be to allow markup in the tab labels. This would allow the addition of things like icons in the labels.

I assume using slots for the tab labels would give the most flexibility, but I'm sure there are other ways as well.

AustinGil commented 4 years ago

You're absolutely right. In fact, I thought about this when I was building the components. Using the named slots was kind of an experiment just to see if it would work, and how it would feel. I like it, but it does have that one flaw.

The challenge for providing flexible content is to ensure that the component is still accessible. Most libraries provide tabs through a "compound" component made up of multiple component (ie + + ), but I've never liked the developer experience of using compound components.

With that said, I think there is a solution, somehow. I've got a couple of ideas, but would need to play around with them.

AustinGil commented 3 years ago

I think this should be solved with the latest version https://vuetensils.stegosource.com/components/tabs.html