Using the Admin Layout
The admin panel provides a complete layout system with Sidebar, Navbar, and MainLayout components.Quick Start
Basic Usage
Full Configuration
Components
MainLayout
The main wrapper that combines Sidebar and Navbar. Props:| Prop | Type | Description |
|---|---|---|
children | JSX.Element | Page content |
navSections | NavSection[] | Custom navigation sections |
companyName | string | Company name in sidebar |
companySubtitle | string | Subtitle under company name |
user | UserProfile | User profile data |
searchPlaceholder | string | Search input placeholder |
notificationCount | number | Number of notifications |
onLogout | () => void | Logout handler |
onNotificationClick | () => void | Notification click handler |
Sidebar
Left navigation panel with company logo, nav items, and footer actions. Features:- ✅ Glassmorphism design
- ✅ Active route highlighting
- ✅ Section headers
- ✅ Badge support
- ✅ Settings and logout actions
- ✅ Mobile responsive (hiddenon mobile)
TbDashboard- DashboardTbUsers- EmployeesTbCalendarEvent- Leave RequestsTbCalendar- CalendarTbChartBar- ReportsTbUserGroup- UsersTbSettings- SettingsTbLogout- LogoutTbLeaf- Company logo
Navbar
Top navigation bar with search, dark mode toggle, notifications, and user profile. Features:- ✅ Glassmorphism design
- ✅ Search bar
- ✅ Dark mode toggle
- ✅ Notification bell with badge
- ✅ User profile with avatar/initials
- ✅ Mobile menu button
- ✅ Responsive design
TbSearch- SearchTbMoon/TbSun- Dark modeTbBell- NotificationsTbMenu2- Mobile menu
Navigation Structure
Default Navigation
The Sidebar comes with default navigation:Custom Navigation
Pass custom navigation sections:Adding Badges
Show notification counts on nav items:User Profile
With Avatar
Without Avatar (Shows Initials)
Dark Mode
The dark mode toggle is built into the Navbar. It:- ✅ Toggles
darkclass ondocument.documentElement - ✅ Shows moon icon in light mode
- ✅ Shows sun icon in dark mode
- ✅ Smooth transitions
Mobile Behavior
Sidebar
- Desktop (
mdbreakpoint and up): Always visible - Mobile: Hidden by default, shown when menu button clicked
- Overlay: Dark backdrop with blur when sidebar is open
- Animation: Slides in from left
Navbar
- Desktop: Shows search bar
- Mobile: Shows menu button, hides search
- User Profile: Shows name and role on large screens only
Page Content Area
The content area insideMainLayout:
- ✅ Automatically scrollable
- ✅ Custom scrollbar styling
- ✅ Proper spacing and padding
- ✅ Full height utilization
Example Pages
See/routes/dashboard-example.tsx for a complete example with:
- MainLayout configuration
- Stat cards
- Content sections
- Proper styling