Moey Icons
No results. Try “dialog”, “dark” or “grid”.
Components

Tab bar

The row of main sections at the bottom of a phone app — where the thumb already is. Three to five places people go all the time, always one tap away. It makes an installed web app feel like an app instead of a website.

The basic bar — tap the tabs
With badges
With a big middle button
<nav class="tabbar" aria-label="Main">
  <a class="tabbar-item" href="#home" aria-current="page"><i class="mi mi-house"></i><span>Home</span></a>
  <a class="tabbar-item" href="#inbox"><i class="mi mi-inbox"></i><span>Inbox</span></a>
  <a class="tabbar-item" href="form-layout#orders"><i class="mi mi-shopping-bag"></i><span>Orders</span></a>
  <a class="tabbar-item" href="#me"><i class="mi mi-user"></i><span>Me</span></a>
</nav>

Add it to your app, step by step

  1. Let the page reach the edges of the phone. Add viewport-fit=cover to your viewport tag. Without it, iPhones keep a blank strip under the bar instead of letting it sit over the home indicator (Moey keeps the buttons clear of it).
    <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
  2. Pick three to five places. The sections people use every day — not everything. Settings, help and the rest go in a "Me" or "More" tab.
  3. Add the bar as the last thing in <body> (or inside your .app), with an icon and a short label per tab. Use <a> for pages and <button> for actions.
  4. Mark where we are with aria-current="page". If you don't, Moey marks the tab whose link matches the address; in single-page apps tapping a tab moves the mark.
  5. That's it. The page gets bottom padding so nothing hides under the bar, toasts float above it, and it steps aside while the keyboard is up. From 1024px wide it disappears — the sidebar or navbar takes over (keep it with .tabbar-always).

Badges

A .tabbar-badge in a tab shows a count; an empty one is a small dot ("something new"). Give a dot an aria-label so screen readers hear it.

<a class="tabbar-item" href="/inbox"><i class="mi mi-inbox"></i><span>Inbox</span><span class="tabbar-badge">12</span></a>
<a class="tabbar-item" href="/alerts"><i class="mi mi-bell"></i><span>Alerts</span><span class="tabbar-badge" aria-label="New"></span></a>

A big middle button

For the one thing people do most — a new post, a scan, a sale. .tabbar-action on a button in the middle: a round brand-colored button whose label is kept for screen readers only.

<button class="tabbar-item tabbar-action" data-moey-open="#newOrder">
  <i class="mi mi-plus"></i><span>New order</span>
</button>

Floating, and hiding on scroll

.tabbar-floating lifts it into a rounded pill. data-moey-hide-on-scroll slides it away while scrolling down (more room to read) and brings it back on the way up, at the top and at the end of the page.

.tabbar-floating
data-moey-hide-on-scroll — scroll the list
<nav class="tabbar tabbar-floating" aria-label="Main">…</nav>
<nav class="tabbar" data-moey-hide-on-scroll aria-label="Main">…</nav>

With the app shell

Phones get the tab bar, wide screens the sidebar — the same sections in both. Put the bar inside the .app; the ☰ sidebar drawer still works for the rest of the menu.

<div class="app">
  <aside class="app-sidebar" popover>…all sections…</aside>
  <div class="app-main">
    <header class="app-topbar">…</header>
    <main class="app-content">…</main>
  </div>
  <nav class="tabbar" aria-label="Main">…the 4 main sections…</nav>
</div>

Accessible

  • It is a <nav> landmark — give it an aria-label ("Main").
  • The current tab is announced ("current page"), and colored — not by color alone: it's the only tab in the brand color, and the label stays.
  • Tabs are 56px tall and share the full width: big, easy targets.
  • It never covers content: the page's bottom padding is set for you (--mo-tabbar-space).

Reference

Class / attributeWhat it does
.tabbarThe bar: fixed to the bottom below 1024px, with room for the home indicator
.tabbar-item (a or button) + aria-current="page"A tab — an icon and a short label; the current one is marked (and set for you when missing)
.tabbar-badgeA count, or a dot when empty
.tabbar-actionThe big round middle button (its label is visually hidden)
.tabbar-floating · .tabbar-alwaysA rounded floating pill · stays on wide screens too
data-moey-hide-on-scrollSlides away while scrolling down
data-moey-no-currentOn a tab: tapping it doesn't move the mark (it opens something)
--mo-tabbar-spaceRead-only: the room the bar takes (the page and toasts use it; 0 when there's no bar)