Bootstrap 5 Mobile App Menu with Icon Tiles
A phone-sized app menu with a two-column grid of icon tiles, a highlighted current item and a header button that switches between grid and list layouts.
<section class="wdw-stage">
<div class="container d-flex flex-column align-items-center gap-4">
<div class="app wdw-aurora rounded-5 p-3 p-sm-4" id="app-menu">
<div class="d-flex justify-content-between align-items-center mb-3">
<button type="button" class="app-round" aria-label="Back"><i class="bi bi-arrow-left" aria-hidden="true"></i></button>
<p class="app-title mb-0 fw-bold" id="app-title">Home</p>
<button type="button" class="app-round" id="app-layout" aria-label="Switch to list view" aria-pressed="false"><i class="bi bi-three-dots-vertical" aria-hidden="true"></i></button>
</div>
<nav aria-label="App menu">
<ul class="app-grid list-unstyled m-0 p-0">
<li><button type="button" class="app-tile is-active" aria-current="page" data-label="Home"><i class="bi bi-house-door" aria-hidden="true"></i><span>Home</span></button></li>
<li><button type="button" class="app-tile" data-label="Likes"><i class="bi bi-heart" aria-hidden="true"></i><span>Likes</span></button></li>
<li><button type="button" class="app-tile" data-label="Stats"><i class="bi bi-bar-chart" aria-hidden="true"></i><span>Stats</span></button></li>
<li><button type="button" class="app-tile" data-label="Pictures"><i class="bi bi-image" aria-hidden="true"></i><span>Pictures</span></button></li>
<li><button type="button" class="app-tile" data-label="Share"><i class="bi bi-send" aria-hidden="true"></i><span>Share</span></button></li>
<li><button type="button" class="app-tile" data-label="Settings"><i class="bi bi-gear" aria-hidden="true"></i><span>Settings</span></button></li>
</ul>
</nav>
</div>
<p class="wdw-muted small mb-0" aria-live="polite">Tap a tile to select it, or use the menu button to change layout.</p>
</div>
</section>
@import url("https://cdnjs.cloudflare.com/ajax/libs/bootstrap-icons/1.11.3/font/bootstrap-icons.min.css");
/* Web Designer Wall library style — shared base for every Bootstrap 5 snippet.
Indigo accent, Plus Jakarta Sans, soft cards, pill buttons. Works in light and dark. */
@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap");
:root,
[data-bs-theme="light"] {
--wdw-font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
--bs-body-font-family: var(--wdw-font);
--bs-primary: #4f46e5;
--bs-primary-rgb: 79, 70, 229;
--bs-primary-text-emphasis: #3730a3;
--bs-primary-bg-subtle: #eef2ff;
--bs-primary-border-subtle: #c7d2fe;
--bs-link-color: #4f46e5;
--bs-link-color-rgb: 79, 70, 229;
--bs-link-hover-color: #4338ca;
--bs-link-hover-color-rgb: 67, 56, 202;
--bs-focus-ring-color: rgba(79, 70, 229, 0.25);
--bs-border-radius: 0.75rem;
--bs-border-radius-lg: 1rem;
--bs-border-radius-xl: 1.25rem;
--wdw-radius-card: 1.25rem;
--wdw-shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 16px 40px -16px rgba(16, 24, 40, 0.22);
--wdw-shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06), 0 4px 12px -4px rgba(16, 24, 40, 0.12);
--wdw-stage: #f5f6fb;
}
[data-bs-theme="dark"] {
--bs-primary: #818cf8;
--bs-primary-rgb: 129, 140, 248;
--bs-primary-text-emphasis: #c7d2fe;
--bs-primary-bg-subtle: rgba(129, 140, 248, 0.14);
--bs-primary-border-subtle: rgba(129, 140, 248, 0.35);
--bs-link-color: #a5b4fc;
--bs-link-color-rgb: 165, 180, 252;
--bs-link-hover-color: #c7d2fe;
--bs-link-hover-color-rgb: 199, 210, 254;
--bs-focus-ring-color: rgba(129, 140, 248, 0.35);
--wdw-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 40px -16px rgba(0, 0, 0, 0.7);
--wdw-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 12px -4px rgba(0, 0, 0, 0.5);
--wdw-stage: #0f1117;
}
body { font-family: var(--wdw-font); -webkit-font-smoothing: antialiased; }
/* Bootstrap compiles its blue into these components; point them at the accent. */
.btn-primary {
--bs-btn-bg: var(--bs-primary); --bs-btn-border-color: var(--bs-primary);
--bs-btn-hover-bg: #4338ca; --bs-btn-hover-border-color: #4338ca;
--bs-btn-active-bg: #3730a3; --bs-btn-active-border-color: #3730a3;
--bs-btn-disabled-bg: var(--bs-primary); --bs-btn-disabled-border-color: var(--bs-primary);
--bs-btn-focus-shadow-rgb: var(--bs-primary-rgb);
}
[data-bs-theme="dark"] .btn-primary { --bs-btn-color: #0f1117; --bs-btn-hover-bg: #a5b4fc; --bs-btn-hover-border-color: #a5b4fc; --bs-btn-hover-color: #0f1117; --bs-btn-active-color: #0f1117; }
.btn-outline-primary {
--bs-btn-color: var(--bs-primary); --bs-btn-border-color: var(--bs-primary);
--bs-btn-hover-bg: var(--bs-primary); --bs-btn-hover-border-color: var(--bs-primary);
--bs-btn-active-bg: var(--bs-primary); --bs-btn-active-border-color: var(--bs-primary);
--bs-btn-focus-shadow-rgb: var(--bs-primary-rgb);
}
.btn { --bs-btn-font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; }
.btn-sm { min-height: 36px; }
.form-control, .form-select { min-height: 44px; border-radius: .75rem; }
.form-control:focus, .form-select:focus, .form-check-input:focus { border-color: rgba(var(--bs-primary-rgb), .6); box-shadow: 0 0 0 .25rem var(--bs-focus-ring-color); }
.form-check-input:checked { background-color: var(--bs-primary); border-color: var(--bs-primary); }
.nav-pills { --bs-nav-pills-link-active-bg: var(--bs-primary); }
.nav { --bs-nav-link-color: var(--bs-secondary-color); --bs-nav-link-hover-color: var(--bs-emphasis-color); }
.pagination { --bs-pagination-active-bg: var(--bs-primary); --bs-pagination-active-border-color: var(--bs-primary); --bs-pagination-color: var(--bs-body-color); --bs-pagination-focus-box-shadow: 0 0 0 .25rem var(--bs-focus-ring-color); }
.progress, .progress-stacked { --bs-progress-bar-bg: var(--bs-primary); }
.list-group { --bs-list-group-active-bg: var(--bs-primary); --bs-list-group-active-border-color: var(--bs-primary); }
.dropdown-menu { --bs-dropdown-link-active-bg: var(--bs-primary); border-radius: .875rem; box-shadow: var(--wdw-shadow-sm); }
.accordion { --bs-accordion-active-bg: var(--bs-primary-bg-subtle); --bs-accordion-active-color: var(--bs-primary-text-emphasis); --bs-accordion-btn-focus-box-shadow: 0 0 0 .25rem var(--bs-focus-ring-color); }
.badge { font-weight: 600; }
/* Library building blocks — use these instead of re-inventing them per snippet. */
.wdw-stage { min-height: 100vh; display: flex; align-items: center; background: var(--wdw-stage); padding-block: 3rem; }
.wdw-card { background: var(--bs-body-bg); border: 1px solid var(--bs-border-color-translucent); border-radius: var(--wdw-radius-card); box-shadow: var(--wdw-shadow); }
.wdw-card-sm { background: var(--bs-body-bg); border: 1px solid var(--bs-border-color-translucent); border-radius: 1rem; box-shadow: var(--wdw-shadow-sm); }
.wdw-aurora { position: relative; color: #fff; background: radial-gradient(60% 55% at 100% 0, #818cf8 0, transparent 70%), radial-gradient(65% 60% at 0 100%, #ec4899 0, transparent 65%), #1e1b4b; }
.wdw-eyebrow { display: inline-block; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--bs-primary); }
.wdw-heading { font-weight: 800; letter-spacing: -.02em; color: var(--bs-emphasis-color); }
.wdw-muted { color: var(--bs-secondary-color); }
.wdw-icon { width: 2.75rem; height: 2.75rem; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: .875rem; background: var(--bs-primary-bg-subtle); color: var(--bs-primary); }
/* Component */
.app { width: 100%; max-width: 340px; box-shadow: 0 30px 60px -24px rgba(30,27,75,.6); overflow: hidden; }
.app-title { font-size: .95rem; letter-spacing: .02em; }
.app-round { width: 44px; height: 44px; border: 0; border-radius: 50%; color: #fff; background: rgba(255,255,255,.16); display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem; backdrop-filter: blur(6px); transition: background-color .15s; }
.app-round:hover { background: rgba(255,255,255,.28); }
.app-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; }
.app-tile { position: relative; width: 100%; aspect-ratio: 1; border: 0; border-radius: 1.25rem; background: transparent; color: rgba(255,255,255,.88); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem; font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; transition: background-color .2s, transform .2s, color .2s; }
.app-tile i { font-size: 1.6rem; }
.app-tile:hover { background: rgba(255,255,255,.1); }
.app-tile.is-active { background: rgba(255,255,255,.2); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.28); }
.app-tile:active { transform: scale(.96); }
.app-round:focus-visible, .app-tile:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.app.is-list .app-grid { grid-template-columns: 1fr; gap: .25rem; }
.app.is-list .app-tile { aspect-ratio: auto; flex-direction: row; justify-content: flex-start; gap: 1rem; padding: .85rem 1.1rem; border-radius: 1rem; min-height: 56px; }
@media (prefers-reduced-motion: reduce) { .app-tile, .app-round { transition: none; } }
(function () {
function initAppMenu() {
var app = document.getElementById('app-menu');
if (!app) return;
var tiles = app.querySelectorAll('.app-tile');
var title = document.getElementById('app-title');
var layout = document.getElementById('app-layout');
tiles.forEach(function (tile) {
tile.addEventListener('click', function () {
tiles.forEach(function (t) {
t.classList.remove('is-active');
t.removeAttribute('aria-current');
});
tile.classList.add('is-active');
tile.setAttribute('aria-current', 'page');
if (title) title.textContent = tile.dataset.label;
});
});
if (layout) layout.addEventListener('click', function () {
var list = app.classList.toggle('is-list');
layout.setAttribute('aria-pressed', list);
layout.setAttribute('aria-label', list ? 'Switch to grid view' : 'Switch to list view');
});
}
initAppMenu();
})();
Built on Bootstrap 5.3.8 with plain JavaScript — no jQuery. Supports light and dark mode via data-bs-theme.