About this set
An underlined tab bar that measures itself and folds the tabs that do not fit into a More menu at the right, the way app and admin navigation behaves on narrow screens. It has six tabs: Overview, Activity, Members, Integrations, Permissions and Billing. Use it when the number of sections is fixed but the width is not, and a scrolling tab bar would hide options without saying so. A ResizeObserver reruns the fitting whenever the bar changes width: every tab is shown, then tabs are hidden from the end until the row fits, skipping the first tab and the selected one, and each hidden tab gets a button in the menu. Choosing a menu item selects that tab, moves it back into the bar and focuses it. The plain CSS and Tailwind versions use a details element for the menu; the Bootstrap version uses .nav-underline with the Tab plugin and a Bootstrap dropdown, and marks folded tabs as disabled so the Tab plugin’s arrow keys skip them.
What’s included
- Tabs that do not fit fold into a More menu
- The selected tab is never folded away
- Refits on every width change with a ResizeObserver
- Full WAI-ARIA tabs keyboard support over the visible tabs
- Bootstrap version pairs .nav-underline with a dropdown
Accessibility
The bar follows the WAI-ARIA tabs pattern in all three versions: role tablist, tab and tabpanel, aria-selected, aria-controls, a roving tabindex, and arrow keys plus Home and End over the tabs that are visible. The More control sits outside the tablist; in the plain and Tailwind versions it is a details disclosure that closes with Escape and returns focus to its summary, and in Bootstrap it is a dropdown with Bootstrap's own keyboard handling. Tabs, menu items and panels show a 2px indigo outline on keyboard focus.
Customise it
The underline and selected colour are #4f46e5 in the .tabs button rules (plain CSS), --bs-nav-underline-link-active-color on .tabs (Bootstrap) or --color-tab-accent (Tailwind). The menu is styled in .pop, the --bs-dropdown-* variables on .dropdown-menu, or the utilities on the menu panel.

















