Tabs: Add an option to allow the tab list to wrap onto multiple lines
What problem does this address?
Currently, the Tabs block keeps all tabs on a single line (flex-wrap: nowrap). When many tabs are added, the current behavior is to render them in a single horizontal row.
Issue #80078 addresses the overflow problem by making the tab list horizontally scrollable. While that prevents page-level horizontal overflow, there may be situations, especially on smaller screens where authors would prefer tabs to wrap onto multiple lines instead of requiring horizontal scrolling.
This enhancement would introduce an optional control that allows authors to choose between the existing single-line layout and a wrapped layout.
Horizontal scrolling is a reasonable default for preserving the visual structure of a tab list. However, it is not always the preferred presentation, particularly for:
- Tabs with short labels that could fit across multiple rows.
- Mobile layouts where horizontal scrolling may reduce discoverability.
- Themes or designs that prefer a stacked tab list over a scrollable one.
Providing an optional wrapping behavior gives authors flexibility without changing the default experience.
What is your proposed solution?
Add a block setting (or layout support) that allows enabling wrapping for the tab list.
When enabled:
- The tab list should use
flex-wrap: wrap. - Tabs should automatically flow onto additional rows when they no longer fit within the available width.
- Existing spacing and alignment should continue to work as expected.
By default, this option would remain disabled, preserving the current single-line behavior.
Step-by-step reproduction instructions
- Enable experimental blocks.
- Insert a Tabs block.
- Add enough tabs that they exceed the available width.
Current behavior
The tab list remains on a single line.
Expected behavior (with enhancement enabled)
The tab list wraps onto multiple rows instead of remaining on a single line.
Follow-up to: #80078 (Default horizontal scrolling fix). This issue tracks an optional wrapping mode for the Tabs block rather than modifying the default behavior.
TThanks for the suggestion. To avoid fragmenting the discussion, let's consolidate this into #80078.