Skip to main content

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.

Dashboard

Stat Cards

Key metrics displayed as prominent cards at the top of the dashboard. Each card features an icon, label, value, and change indicator.

Total Users
24,521
+12.5%vs last month
Revenue
$84,230
+8.2%vs last month
Orders
1,429
+23.1%vs last month
Growth
18.2%
+4.3%vs last month

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

+12.5%
$350
$550
$450
$700
$600
$800
$650
$900
$750
$850
$700
$950
JFMAMJJASOND

User Growth

Active users over time

24.5k
JanMarMayJulSepNov

Recent Activity

An activity feed showing recent user actions with avatars, descriptions, and timestamps. Perfect for keeping track of team activity.

Activity Feed

SC

Sarah Chen created a new project

2 min ago
MJ

Marcus Johnson deployed v2.4.1 to production

15 min ago
EP

Emily Park resolved 3 critical issues

1 hour ago
AR

Alex Rivera added new team members

3 hours ago
JL

Jordan Lee updated billing settings

5 hours ago

Data Table

A structured table for displaying recent orders and transactions with status badges, amounts, and action items.

Recent Orders

Showing 5 of 128
OrderCustomerAmountStatus
#ORD-7821Acme Corp$2,340Completed
#ORD-7820Globex Inc$1,890Processing
#ORD-7819Initech LLC$4,120Completed
#ORD-7818Umbrella Co$960Pending
#ORD-7817Stark Ind$3,750Completed

The foundational layout structure combining a fixed sidebar navigation, top header bar with search and user menu, and a scrollable main content area.

Dashboard
JD
Total Users
24,521
Revenue
$84,230
Orders
1,429
Growth
18.2%
Revenue Trend
Recent Activity
SC
Sarah Chen created a new project
MJ
Marcus Johnson deployed v2.4.1 to production
EP
Emily Park resolved 3 critical issues

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.

Desktop
Tablet
Mobile
Responsive tips: Use 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.

app/dashboard/layout.tsx
tsx
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>
  );
}
app/dashboard/page.tsx
tsx
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.

Components commonly used when building dashboard layouts.