---
name: mobile-bottom-navbar
description: Standardized mobile bottom navigation implementation for internal Next.js applications. Provides role-based filtering, smooth animations, persistent state, and submenu expansion with accordion-based More menu. Supports Next.js 15+ with App Router, TypeScript, Zustand state management, and Framer Motion animations. Includes complete ready-to-use components with icon grid layouts, comprehensive documentation, and customization guides.
triggers:
- mobile nav
- bottom navbar
- mobile navigation
- add mobile nav
- create bottom bar
- mobile bottom navigation
- bottom navigation bar
- mobile menu
---
# Mobile Bottom Navbar
## Overview
This skill provides a complete, production-ready mobile bottom navigation system for Next.js 15+ applications with App Router. The implementation features:
- **3-Column Icon Grid Layouts** for submenus and More menu
- **Accordion-Based More Menu** with collapsible group sections
- **Submenu Dropdown** appearing above the navbar
- Role-based filtering and smooth animations
**πΈ Visual Reference:** See `references/screenshots/` for actual UI examples from MyJKKN application.
### Key Features
- **Icon Grid Submenus**: 3-column grid layout with icons + labels (like iOS app grid)
- **Accordion More Menu**: Collapsible sections showing all overflow menu groups
- **Always Visible Design**: Full navbar always shown on mobile (no separate minimized state)
- **Role-Based Filtering**: Dynamic navigation based on user permissions
- **Smart Active Detection**: Automatically highlights current page
- **Submenu Expansion**: Click nav items to expand submenus with backdrop overlay
- **Overflow Handling**: "More" menu for navigation groups beyond primary 4 items
- **State Persistence**: Zustand with localStorage for cross-session state
- **Hydration Safety**: Prevents flash of incorrect state on page load
- **Smooth Animations**: Spring-based animations via Framer Motion
- **iOS Safe Area Support**: Respects notch and home indicator spacing
- **TypeScript First**: Fully typed for excellent DX
- **Customizable**: Colors, animations, layouts, and icons
### UI Pattern (Critical Design Elements)
#### β
Bottom Navbar
```
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β [Icon] [Icon] [Icon] [Icon] [Icon] β
β Overview User Mgmt Apps App Hub More (5+) β
β β β β Active indicator
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
```
- 4 primary items + "More" button with badge count
- Even spacing, icons with labels below
- Active state: primary color + underline indicator
#### β
Submenu Dropdown (Opens ABOVE navbar)
```
βββββββββββββββββββββββββββββββββββββββ
β βββββββ βββββββ βββββββ β
β β π β β π€ β β β β β 3-column grid
β βDash β β AI β β β β
β βββββββ βββββββ βββββββ β
βββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββ β Navbar (below)
```
- Grid layout (3 columns)
- Icon + label cards
- Appears above navbar with backdrop
#### β
More Menu Modal (Accordion with Icon Grid)
```
βββββββββββββββββββββββββββββββββββββββ
β All Menus β β
βββββββββββββββββββββββββββββββββββββββ€
β > Organization Management 9 βΌ β β Accordion header with count
β β
β βββββββ βββββββ βββββββ β
β β π’ β β π β β π₯ β β β 3-column icon grid
β βInst β βDegr β βDept β β
β βββββββ βββββββ βββββββ β
β βββββββ βββββββ βββββββ β
β β π β β π
β β π β β
β βProg β βSeme β βSect β β
β βββββββ βββββββ βββββββ β
β βββββββ βββββββ βββββββ β
β β π β β πΊοΈ β β β β
β βCour β βMaps β β β β
β βββββββ βββββββ βββββββ β
β β
β > Finance Management 6 βΆ β β Collapsed section
β β
βββββββββββββββββββββββββββββββββββββββ
```
**Critical Pattern Elements:**
1. **Sheet Component**: Bottom sheet with rounded top (`rounded-t-3xl`)
2. **Accordion**: `type="multiple"` with all groups expanded by default
3. **Group Headers**: Icon badge + label + count + chevron
4. **Submenu Grid**: 3-column layout with icons and labels
5. **Active Highlighting**: Primary color ring and background
### When to Use This Skill
Use this skill when:
- Implementing mobile navigation for Next.js 15+ App Router applications
- Needing role-based or permission-based navigation filtering
- Building internal applications with consistent navigation patterns
- Requiring persistent navigation state across sessions
- Supporting iOS devices with safe area insets
- Wanting smooth, professional animations without performance issues
- **Need accordion-style More menu with icon grid submenus**
### Auto-Trigger Keywords
This skill automatically activates when you mention:
- "mobile nav", "mobile navigation", "mobile bottom navigation"
- "bottom navbar", "bottom navigation bar", "bottom bar"
- "add mobile nav", "create bottom bar", "implement mobile menu"
## Quick Start
### 1. Install Dependencies
```bash
npm install zustand framer-motion lucide-react clsx tailwind-merge
```
Required shadcn/ui components:
```bash
npx shadcn@latest add sheet accordion scroll-area
```
### 2. Copy Core Files
Copy all files from `assets/` to your project:
```
assets/
βββ components/BottomNav/
β βββ bottom-navbar.tsx β components/BottomNav/
β βββ bottom-nav-item.tsx β components/BottomNav/
β βββ bottom-nav-submenu.tsx β components/BottomNav/
β βββ bottom-nav-more-menu.tsx β components/BottomNav/ β¨ KEY COMPONENT
β βββ bottom-nav-minimized.tsx β components/BottomNav/
β βββ types.ts β components/BottomNav/
β βββ index.ts β components/BottomNav/
βββ hooks/
βββ use-bottom-nav.ts β hooks/
βββ use-mobile.tsx β hooks/
```
**β οΈ IMPORTANT:** Always use the complete `bottom-nav-more-menu.tsx` from assets to ensure proper accordion + icon grid pattern.
### 3. Integrate with Layout
```typescript
// app/(routes)/layout.tsx
'use client';
import { cn } from '@/lib/utils';
import { useIsMobile } from '@/hooks/use-mobile';
import { BottomNavbar } from '@/components/BottomNav';
export default function MainLayout({ children }) {
const isMobile = useIsMobile();
return (
<>