Components
Nav overflow
When links or tabs don't fit, the last ones move into a More menu instead of wrapping onto a second line or hiding off the edge. The page you're on always stays in view. On phones, More opens as a bottom sheet.
Drag the corner of the box to make it narrower.
<nav class="nav nav-underline nav-overflow" aria-label="Store">
<a href="/overview">Overview</a>
<a href="/orders" aria-current="page">Orders</a>
<a href="/customers">Customers</a>
<a href="/products">Products</a>
<a href="/invoices">Invoices</a>
<a href="/reports">Reports</a>
<a href="/discounts">Discounts</a>
<a href="/settings">Settings</a>
</nav>
Pills and icons
<nav class="nav nav-pills nav-overflow" aria-label="Workspace">
<a href="/" aria-current="page"><i class="mi mi-house"></i>Home</a>
<a href="/inbox"><i class="mi mi-inbox"></i>Inbox <span class="badge badge-count">12</span></a>
…
</nav>
Tabs
Add .tabs-overflow to tabs. Picking a tab from More selects it and brings it into the row; the arrow keys move between the tabs you can see.
General settings.
Billing settings.
Team settings.
Notifications settings.
Security settings.
Integrations settings.
API keys settings.
<div class="tabs tabs-overflow">
<div class="tab-list">
<button class="tab">General</button>
<button class="tab">Billing</button>
…
</div>
<div class="tab-panel">…</div>
…
</div>
From code
nav.addEventListener('moey:overflow', (e) => e.detail.hidden); // the items now in More
| Class / attribute | What it does |
|---|---|
.nav-overflow | On a .nav (any style): what doesn't fit moves into More |
.tabs-overflow | The same for .tabs |
data-moey-more="…" | The button's name (default “More”) |
moey:overflow | Fires when the items in More change |
Vertical navs and tabs never run out of width, so they're left as they are.