[ Feature Request ] [ TabContainer ] Add Slot to TabInStrip & TabInOverflow & TabSeparator to make them more conveniently be customized
Hi UI5 WebComponents team, I am hubery shen from Successfactors. I are using tab container component. Thanks you for giving me the example about how to extend the tab container by writing web component code. But If slots be added to TabInStrip & TabInOverflow & TabSeparator, it will be more conveniently for them be customized.
TabContainer Website
Feature Request Description
Add Slot to TabInStrip & TabInOverflow & TabSeparator to make them more conveniently be customized
Expected Code
Customize TabInStrip by slot
<ui5-tab>
<div slot="custom-strip"> my codes ...</div>
</ui5-tab>

Customize TabSeparator by slot
<ui5-tab-separator>
<div slot="custom-separator"> my codes ...</div>
</ui5-tab-separator>

Customize TabInOverflow by slot
<ui5-tab-overflow>
<div slot="custom-overflow"> my codes ...</div>
</ui5-tab-overflow>

Hi @Hubery-Shen ,
After thinking about the proposed solution, there are two fundamental problems that don't allow us to proceed with it:
- If the tab container slots tabs, and tabs slot other items (
<div slot="strip">), we can't display the other items in the tab container, only in the tab. Therefore a nested structure, in which a tab slots other items, representing it in the tab strip and overflow menu is not possible. The only possibility would be to have a flat structure, where the tab container gets as direct children tabs, tab strip items and overflow items. But then we get back to the same question - how do we link these to one another? - The second problem is that the tab container needs to change the CSS of the items when the user clicks on the tabs. The most common functionality is to set the "selected" state of a tab - currently background + bottom border. This is now possible since the tab container builds and knows the tab strip items so it modifies them at will. But if you pass from the outside arbitrary items, the tab container won't know how to change them to look selected for example. Other similar states are focused and disabled. There are also, although less important, the semantic variations - positive/negative/information/etc... The only reliable way to solve the problem would be to have specific web components for the strip items, imagine
<ui5-tab-strip-itemwith predefined properties such asselected,focused,disabledand then the tab container would not change CSS, but would rather directly manipulate the items' public API:stripItem.selected = true;. This would work, but again, you would need to create custom items by extending the existing tab or something similar. So this won't be a "no-new-elements" solution either.
We still believe that the right approach would be to create a custom tab container, even if used for one app only, as it will implement the needed design and behavior. You could add more properties to make it more universal, so you don't need to create two custom elements for two different tab containers in the same app for example. Let's discuss further on the next meeting.
Regards, Vladi
Hi @vladitasev , Thanks vladitasev. Let's discuss further on the meeting.
Hello @Hubery-Shen Vladi explained the obstacles with the proposal, do you have some input on the topic? As there is no update since a month I am closing the issue, but feel free to reopen it in case you have an update.