The design team for my project created a mockup for a tab component solution. In the mockup, if there are a surplus of tabs - meaning there are more tabs than can fit in the available horizontal space - any tab(s) that would be truncated is removed and placed in a flyout/drop down menu. Here is an example where there are 6 tabs, but the last three would be truncated given the screen size:
Here is some sample markup:
<div class="tabs-container">
<ul>
<li>
<button type="button">Tab 1</button>
</li>
<li>
<button type="button">Tab 2</button>
</li>
<li>
<button type="button">Tab 3</button>
</li>
</ul>
<div class="tabs-panel is-active">Tab 1 Content</div>
<div class="tabs-panel">Tab 2 Content</div>
<div class="tabs-panel">Tab 3 Content</div>
</div>
I'm currently using the react-tabs
library to render my tabs, but the feature described above is not part of that solution. This feature could be accomplished with plain javascript/jQuery, but that would be non-ideal.
Can this be accomplished with HTML/CSS or even ReactJS?