Skip to content
v0.9.1
Components

Nav overflow

When links or tabs do not fit, the last ones move into a "More" menu instead of scrolling off the edge. The page you are on always stays in view. On phones, More opens as a bottom sheet.

A row of links

Add data-momo-overflow to any row of tabs. Drag the corner of the dashed box to make it narrower and watch the links move into More.

<div class="docs-resize">
  <nav class="tabs tabs-line" data-momo-overflow aria-label="Store" id="ov-links">
    <a class="tab" href="#overview">Overview</a>
    <a class="tab" href="#orders" aria-current="page">Orders</a>
    <a class="tab" href="#customers">Customers</a>
    <a class="tab" href="#products">Products</a>
    <a class="tab" href="#invoices">Invoices</a>
    <a class="tab" href="#reports">Reports</a>
    <a class="tab" href="#discounts">Discounts</a>
    <a class="tab" href="#settings">Settings</a>
  </nav>
</div>
<nav class="tabs tabs-line" data-momo-overflow aria-label="Store">
  <a class="tab" href="/overview">Overview</a>
  <a class="tab" href="/orders" aria-current="page">Orders</a>
  <a class="tab" href="/customers">Customers</a>
  …
</nav>

Pills, icons and counts

It works with every tab style. Icons and counts come along into the menu. data-momo-overflow="Other" changes the button's word.

<div class="docs-resize" style="width: 34rem">
  <nav class="tabs tabs-pill" data-momo-overflow="Other" aria-label="Workspace" id="ov-pills">
    <a class="tab" href="#home" aria-current="page"><i class="mi mi-house"></i>Home</a>
    <a class="tab" href="#inbox"><i class="mi mi-inbox"></i>Inbox <span class="badge-count">12</span></a>
    <a class="tab" href="#calendar"><i class="mi mi-calendar"></i>Calendar</a>
    <a class="tab" href="#team"><i class="mi mi-users"></i>Team</a>
    <a class="tab" href="#reports"><i class="mi mi-chart-bar"></i>Reports</a>
    <a class="tab" href="#files"><i class="mi mi-folder"></i>Files <span class="badge-count">3</span></a>
    <a class="tab" href="#settings"><i class="mi mi-settings"></i>Settings</a>
  </nav>
</div>

Real tabs

With data-momo-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

Shop name, address and time zone. Customers see the name on receipts and emails.

<div class="docs-resize" style="width: 30rem">
  <div class="tabs" data-momo-tabs data-momo-overflow aria-label="Settings" id="ov-tabs">
    <button class="tab" aria-controls="ov-p-general" aria-selected="true">General</button>
    <button class="tab" aria-controls="ov-p-billing">Billing</button>
    <button class="tab" aria-controls="ov-p-team">Team</button>
    <button class="tab" aria-controls="ov-p-notifications">Notifications</button>
    <button class="tab" aria-controls="ov-p-security">Security</button>
    <button class="tab" aria-controls="ov-p-integrations">Integrations</button>
    <button class="tab" aria-controls="ov-p-api">API keys</button>
  </div>
  <div class="tab-panel" id="ov-p-general"><h3 class="mt-0">General</h3><p class="mb-0">Shop name, address and time zone. Customers see the name on receipts and emails.</p></div>
  <div class="tab-panel" id="ov-p-billing" hidden><h3 class="mt-0">Billing</h3><p class="mb-0">Your plan is Team, $29 a month. The next invoice is on December 14.</p></div>
  <div class="tab-panel" id="ov-p-team" hidden><h3 class="mt-0">Team</h3><p class="mb-0">Six people have access. Owners can invite others and change roles.</p></div>
  <div class="tab-panel" id="ov-p-notifications" hidden><h3 class="mt-0">Notifications</h3><p class="mb-0">Email for new orders is on. Weekly summaries arrive on Monday morning.</p></div>
  <div class="tab-panel" id="ov-p-security" hidden><h3 class="mt-0">Security</h3><p class="mb-0">Two-step sign-in is on for everyone. The last password change was 3 weeks ago.</p></div>
  <div class="tab-panel" id="ov-p-integrations" hidden><h3 class="mt-0">Integrations</h3><p class="mb-0">Connected: the accounting app and the shipping labels. Two more are waiting for approval.</p></div>
  <div class="tab-panel" id="ov-p-api" hidden><h3 class="mt-0">API keys</h3><p class="mb-0">One live key, created in March. Keys are shown once, so store them somewhere safe.</p></div>
</div>
<div class="tabs" data-momo-tabs data-momo-overflow aria-label="Settings">
  <button class="tab" aria-controls="p-general" aria-selected="true">General</button>
  <button class="tab" aria-controls="p-billing">Billing</button>
  …
</div>
<div class="tab-panel" id="p-general">…</div>
<div class="tab-panel" id="p-billing" hidden>…</div>

Good to know

nav.addEventListener('momo:overflow', (e) => {
  console.log(e.detail.hidden);   // the items now in More
});

Reference

Attribute / APIWhat it does
data-momo-overflowOn a .tabs row (any style): what does not fit moves into More
data-momo-overflow="Other"The button's word ("More" by default)
Event momo:overflowThe items in More changed; detail: { hidden }
Momo.overflow(row).update()Measure again after you change the items
.tabs-more, .has-moreThe More button, the row while something is in More (for your own styling)

Start

OverviewStart Getting startedStart CustomizeStart

Guides

AccessibilityGuides BreakpointsGuides ChangelogGuides Customize componentsGuides JavaScriptGuides MotionGuides OptimizeGuides PhonesGuides RebootGuides Right-to-left (RTL)Guides Stacking orderGuides Using Momo with AIGuides

Foundations

ColorsFoundations TypographyFoundations ProseFoundations Images & figuresFoundations CodeFoundations Lines & shadowsFoundations Dark modeFoundations

Forms

Checkbox & switchForms ComboboxForms Date pickerForms Date rangeForms Fields & labelsForms File uploadForms Floating labelsForms Number stepperForms PasswordForms PIN codeForms RatingForms SelectForms SliderForms Tag inputForms Time pickerForms ValidationForms

Components

AccordionComponents Alert & bannerComponents AvatarComponents BadgeComponents BreadcrumbComponents ButtonComponents Button groupComponents CalendarComponents CardComponents CarouselComponents ChartsComponents ChipsComponents CollapseComponents Command paletteComponents CommentsComponents Confirm dialogsComponents Cookie bannerComponents Data tableComponents Description listComponents Dialog & toastComponents DividerComponents DrawerComponents Dropdown menuComponents Empty stateComponents File managerComponents Filter & sortComponents Gallery & lightboxComponents Inbox & chatComponents Infinite scrollComponents KanbanComponents Keyboard shortcutsComponents List groupComponents MarqueeComponents Media objectComponents Nav overflowComponents Notification centerComponents PaginationComponents ProgressComponents Pull to refreshComponents SkeletonComponents SortableComponents SpinnerComponents Split viewComponents Stat cardComponents Steps & wizardComponents Swipe actionsComponents TableComponents TabsComponents TimelineComponents TogglerComponents Tooltip & popoverComponents TourComponents Tree viewComponents VideoComponents WhiteboardComponents

Layout

Announcement barLayout App shellLayout Back to topLayout Container & sectionLayout ExamplesLayout FooterLayout HeroLayout JumbotronLayout Mega menuLayout NavbarLayout Site sidebarLayout

Sections

Bento gridSections Blog cardsSections Call to actionSections Contact & newsletterSections FAQSections FeaturesSections Logo cloudSections PricingSections TeamSections TestimonialsSections

Utilities

OverviewUtilities State variantsUtilities Display & flexUtilities Grid & gapUtilities SpacingUtilities SizingUtilities TextUtilities Links & color strengthUtilities Position & overflowUtilities BackgroundsUtilities Borders & effectsUtilities Transforms & filtersUtilities InteractionsUtilities

Helpers

Fixed, sticky & frostedHelpers Hover & focusHelpers Hover revealHelpers Icon linkHelpers PrintHelpers Relative timeHelpers Screen reader textHelpers Scroll inHelpers ScrollspyHelpers Share buttonHelpers Skip linkHelpers StacksHelpers Stretched linkHelpers Theme toggleHelpers Truncated textHelpers

Page patterns

404 pagePage patterns Coming soonPage patterns Login & registerPage patterns SettingsPage patterns ProfilePage patterns CRM contactsPage patterns ProjectsPage patterns File manager pagePage patterns Billing & plansPage patterns Help centerPage patterns Mobile app screensPage patterns
↑ ↓ moveEnter openEsc close