Dashboard Layout
A comprehensive pattern for building modern admin dashboards. Combines sidebar navigation, stat cards, data visualizations, activity feeds, and data tables into a cohesive, responsive layout.
Overview
A typical dashboard layout features a sidebar for navigation, a top header bar, and a main content area with stat cards, charts, and data tables.
Stat Cards
Key metrics displayed as prominent cards at the top of the dashboard. Each card features an icon, label, value, and change indicator.
Charts Section
Data visualizations for trends and comparisons. A bar chart for monthly breakdown and a line chart for continuous metrics.
Monthly Revenue
Jan - Dec 2026
User Growth
Active users over time
Recent Activity
An activity feed showing recent user actions with avatars, descriptions, and timestamps. Perfect for keeping track of team activity.
Activity Feed
Sarah Chen created a new project
Marcus Johnson deployed v2.4.1 to production
Emily Park resolved 3 critical issues
Alex Rivera added new team members
Jordan Lee updated billing settings
Data Table
A structured table for displaying recent orders and transactions with status badges, amounts, and action items.
Recent Orders
Showing 5 of 128| Order | Customer | Amount | Status | Date |
|---|---|---|---|---|
| #ORD-7821 | Acme Corp | $2,340 | Completed | Jul 9, 2026 |
| #ORD-7820 | Globex Inc | $1,890 | Processing | Jul 9, 2026 |
| #ORD-7819 | Initech LLC | $4,120 | Completed | Jul 8, 2026 |
| #ORD-7818 | Umbrella Co | $960 | Pending | Jul 8, 2026 |
| #ORD-7817 | Stark Ind | $3,750 | Completed | Jul 7, 2026 |
Sidebar + Header Layout
The foundational layout structure combining a fixed sidebar navigation, top header bar with search and user menu, and a scrollable main content area.
Admin Panel
Responsive Dashboard
How the dashboard layout adapts across screen sizes. The sidebar collapses on tablet and mobile, stat cards stack, and the layout shifts to a single column.
lg:grid-cols-4 for stat cards, hide the sidebar below md breakpoint with a hamburger toggle, and stack charts vertically on small screens.Code Example
A reference implementation showing the recommended layout structure for a dashboard page.
export default function DashboardLayout({
children,
}: {
children: React.ReactNode;
}) {
return (
<div className="flex h-screen bg-(--surface-sunken)">
{/* Sidebar */}
<aside className="hidden md:flex w-60 flex-col border-r
border-(--border) bg-(--surface-elevated)">
<div className="p-4 border-b border-(--border)">
<Logo />
</div>
<nav className="flex-1 p-3 space-y-1">
<NavItem href="/dashboard" active>Dashboard</NavItem>
<NavItem href="/analytics">Analytics</NavItem>
<NavItem href="/customers">Customers</NavItem>
<NavItem href="/orders">Orders</NavItem>
<NavItem href="/settings">Settings</NavItem>
</nav>
<UserMenu />
</aside>
{/* Main content */}
<div className="flex-1 flex flex-col min-w-0">
<header className="h-14 border-b border-(--border)
bg-(--surface-elevated) flex items-center px-6
justify-between">
<SearchBar />
<div className="flex items-center gap-3">
<NotificationBell />
<UserAvatar />
</div>
</header>
<main className="flex-1 overflow-auto p-6">
{children}
</main>
</div>
</div>
);
}export default function DashboardPage() {
return (
<div className="space-y-6">
{/* Stat Cards */}
<div className="grid grid-cols-1 sm:grid-cols-2
lg:grid-cols-4 gap-4">
<StatCard
label="Total Users"
value="24,521"
change="+12.5%"
icon={<UserGroupIcon />}
/>
<StatCard
label="Revenue"
value="$84,230"
change="+8.2%"
icon={<DollarCircleIcon />}
/>
{/* ... more cards */}
</div>
{/* Charts */}
<div className="grid grid-cols-1 md:grid-cols-2 gap-6">
<RevenueChart />
<UserGrowthChart />
</div>
{/* Activity + Table */}
<div className="grid grid-cols-1 lg:grid-cols-3 gap-6">
<div className="lg:col-span-2">
<RecentOrdersTable />
</div>
<ActivityFeed />
</div>
</div>
);
}Best Practices
Design and implementation guidelines for building effective, user-friendly dashboards.
Prioritize key metrics
Place the most important KPIs at the top as stat cards. Users should see critical data at a glance without scrolling.
Use consistent spacing
Maintain a regular grid rhythm with design tokens for spacing. Use gap-4 or gap-6 between sections for visual breathing room.
Keep sidebar focused
Limit sidebar navigation to 5-7 primary items. Group secondary items in collapsible sections or move them to settings.
Design for loading states
Use skeleton loaders for charts and tables. Show placeholder stat cards while data loads to prevent layout shift.
Optimize for real-time data
Use SWR or React Query for data fetching with stale-while-revalidate. Avoid full page refreshes for metric updates.
Accessible color coding
Never rely on color alone for status. Pair colors with icons, labels, or patterns. Ensure 4.5:1 contrast ratio for text.
Related
Components commonly used when building dashboard layouts.