App shell
The frame of an app: a black sidebar, a top bar, the content, a footer, and a tab bar on phones. On screens under 992px the sidebar slides in from a menu button.
Open the dashboard example on its own. Make the window narrow to see the phone layout.
Structure
<div class="app">
<aside class="sidebar" aria-label="Main">
<a class="sidebar-brand" href="/">Momo</a>
<p class="sidebar-title">Navigation</p>
<ul class="sidebar-nav">
<li><a class="sidebar-link" href="/" aria-current="page"><i class="mi mi-layout-dashboard"></i> Dashboard <span class="sidebar-count">15</span></a></li>
<li><a class="sidebar-link" href="/files"><i class="mi mi-file"></i> Files <span class="sidebar-count bg-green">14</span></a></li>
</ul>
<div class="sidebar-foot">…</div>
</aside>
<div class="app-main">
<header class="topbar">
<button class="btn btn-icon btn-ghost app-menu-btn" data-momo-sidebar aria-label="Open menu"><i class="mi mi-menu"></i></button>
<h1 class="topbar-title">Dashboard</h1>
<div class="topbar-actions">…</div>
</header>
<main class="app-content">…</main>
<footer class="app-footer">…</footer>
</div>
<nav class="tabbar" aria-label="Quick links">…</nav>
</div>Sidebar
.sidebar-brandat the top,.sidebar-titlefor groups,.sidebar-navlists of.sidebar-link,.sidebar-footat the bottom (the signed-in person).- Mark the current page with
aria-current="page": it gets the brand color. .sidebar-countis the square number on the right; color it with.bg-<color>..sidebar-lightmakes it white with an ink line instead of black.- On phones and tablets, a button with
data-momo-sidebarslides it in. Tapping outside, Esc, or picking a link closes it.
Top bar
.topbarsticks to the top..topbar-titleis the page name,.topbar-actionssits on the right..topbar-searchand.topbar-hide-smhide under 992px to save room.- Put a
.dotin an icon button for "something new"; write a number in it for a count.
<button class="btn btn-icon" type="button" aria-label="Notifications, new"><i class="mi mi-bell"></i><span class="dot"></span></button>
<button class="btn btn-icon" type="button" aria-label="Messages, 3 new"><i class="mi mi-message-square"></i><span class="dot">3</span></button>
<button class="btn btn-icon btn-ghost" type="button" aria-label="Alerts, 5 new"><i class="mi mi-bell"></i><span class="dot bg-yellow">5</span></button>Tab bar
Under 768px wide, .tabbar pins icon links to the bottom of the screen; the page gets room for it, and toasts sit above it. .tabbar-ink makes it black. A .tabbar-fab in the middle is the big round action: brand color on a light bar, the light brand shade on a black one (so it never disappears). Pick your own with --tabbar-fab-bg and --tabbar-fab-color on the tab bar, for example style="--tabbar-fab-bg: var(--momo-yellow)". With a middle button, put the same number of tabs on each side (two and two) so it sits in the centre.
Variables
| Variable | Default |
|---|---|
--sidebar-width | 16.5rem |
--sidebar-bg / --sidebar-color / --sidebar-muted / --sidebar-hover | #161616 / off-white / gray / #262626 |
--topbar-height | 4.5rem |
--momo-tabbar-space | 4rem when a tab bar shows (toasts use it) |