# Executive dashboard

> A concise performance overview with capacity and account data.

URL: https://basaltui.com/templates/executive-dashboard · Markdown: https://basaltui.com/templates/executive-dashboard.md

- Category: `dashboards`
- Height: `48rem`
- Workbench: https://basaltui.com/templates/executive-dashboard
- Live preview: https://basaltui.com/view/executive-dashboard

## Package Imports

- `@nocoo/basalt/components/app-header`
- `@nocoo/basalt/components/app-shell`
- `@nocoo/basalt/components/badge`
- `@nocoo/basalt/components/data-table`
- `@nocoo/basalt/components/input`
- `@nocoo/basalt/components/layer-card`
- `@nocoo/basalt/components/meter`
- `@nocoo/basalt/components/page-header`
- `@nocoo/basalt/components/sidebar`
- `@nocoo/basalt/components/stat-card`
- `lucide-react`
- `react`

## What's inside

- **Navigation rail** (`#exec-sidebar`): Workspace shell rail with anchor jump to the account ledger on mobile and desktop. Components: [Sidebar](https://basaltui.com/ui/sidebar.md), [Button](https://basaltui.com/ui/button.md).
- **KPI stat grid** (`#exec-kpis`): Four-column StatGrid displaying revenue, active accounts, retention, and open orders. Components: [Page Header](https://basaltui.com/ui/page-header.md), [StatCard](https://basaltui.com/ui/stat-card.md).
- **Capacity & channel meters** (`#exec-capacity`): Side-by-side LayerCards summarizing utilization and acquisition mix with Meter bars. Components: [Layer Card](https://basaltui.com/ui/layer-card.md), [Meter](https://basaltui.com/ui/meter.md).
- **Filterable account table** (`#account-list`): Attached DataTable with live search input, column sorting, and semantic status badges. Components: [Layer Card](https://basaltui.com/ui/layer-card.md), [Input](https://basaltui.com/ui/input.md), [DataTable](https://basaltui.com/ui/data-table.md), [Badge](https://basaltui.com/ui/badge.md).

## Make it yours

1. **Set organization title and metrics** (`EXECUTIVE_CONFIG`): Edit EXECUTIVE_CONFIG to configure brand title, page description, and overview metadata.
2. **Supply account dataset** (`ACCOUNTS`): Replace ACCOUNTS with live CRM or billing data matching your domain model.
3. **Extend table columns** (`COLUMNS`): Customize COLUMNS with additional sortable metrics, owners, or health indicators.
4. **Mount styles & providers**: Wrap your application root in `ThemeProvider` and `LinkProvider`, and import `@nocoo/basalt/styles` (or `@nocoo/basalt/styles/tailwind` / `@nocoo/basalt/styles/standalone`) plus `@nocoo/basalt/fonts.css`.

## Source

```tsx
"use client";

import { AppHeader, AppHeaderMenuButton } from "@nocoo/basalt/components/app-header";
import { AppMain, AppShell, AppSkipLink } from "@nocoo/basalt/components/app-shell";
import { Badge } from "@nocoo/basalt/components/badge";
import { DataTable, type DataTableColumn } from "@nocoo/basalt/components/data-table";
import { Input } from "@nocoo/basalt/components/input";
import { LayerCard } from "@nocoo/basalt/components/layer-card";
import { Meter } from "@nocoo/basalt/components/meter";
import { PageHeader } from "@nocoo/basalt/components/page-header";
import {
	ContentIsland,
	Sidebar,
	SidebarBrand,
	SidebarDrawer,
	SidebarHeader,
	SidebarItem,
	SidebarNav,
	SidebarProvider,
	SidebarToggle,
} from "@nocoo/basalt/components/sidebar";
import { StatCard, StatGrid } from "@nocoo/basalt/components/stat-card";
import { BarChart3, LayoutDashboard, Users } from "lucide-react";
import { useEffect, useRef, useState, useSyncExternalStore } from "react";

const mobileQuery = "(width < 768px)";
function subscribeMobile(notify: () => void) {
	const media = window.matchMedia(mobileQuery);
	media.addEventListener("change", notify);
	return () => media.removeEventListener("change", notify);
}
function isMobile() {
	return window.matchMedia(mobileQuery).matches;
}
function serverMobile() {
	return false;
}

export const EXECUTIVE_CONFIG = {
	brandName: "Northstar",
	headerTitle: "Overview",
	title: "Executive overview",
	description: "A clear view of performance and capacity.",
} as const;

type Account = { name: string; owner: string; revenue: number; status: "On track" | "At risk" };
const ACCOUNTS: Account[] = [
	{ name: "Northstar", owner: "Maya Chen", revenue: 124000, status: "On track" },
	{ name: "Meridian", owner: "Alex Rivera", revenue: 98000, status: "On track" },
	{ name: "Evergreen", owner: "Sam Brooks", revenue: 76000, status: "At risk" },
	{ name: "Harbor", owner: "Maya Chen", revenue: 62000, status: "On track" },
];
const COLUMNS: DataTableColumn<Account>[] = [
	{ id: "name", header: "Account", accessor: (row) => row.name, sortValue: (row) => row.name },
	{ id: "owner", header: "Owner", accessor: (row) => row.owner, sortValue: (row) => row.owner },
	{
		id: "revenue",
		header: "Revenue",
		accessor: (row) => `$${row.revenue.toLocaleString()}`,
		sortValue: (row) => row.revenue,
		textAlign: "end",
	},
	{
		id: "status",
		header: "Status",
		accessor: (row) => (
			<Badge dot tone={row.status === "At risk" ? "warning" : "success"}>
				{row.status}
			</Badge>
		),
		sortValue: (row) => row.status,
		filterValue: (row) => row.status,
	},
];

export default function ExecutiveDashboardTemplate() {
	const [filter, setFilter] = useState("");
	const [drawerOpen, setDrawerOpen] = useState(false);
	const navigationTrigger = useRef<HTMLButtonElement>(null);
	const mobile = useSyncExternalStore(subscribeMobile, isMobile, serverMobile);
	useEffect(() => {
		if (!mobile) setDrawerOpen(false);
	}, [mobile]);
	function sidebar(drawer: boolean) {
		return (
			<Sidebar resizable={false}>
				<SidebarHeader>
					<SidebarBrand
						logo={<BarChart3 />}
						name={EXECUTIVE_CONFIG.brandName}
						action={
							drawer ? (
								<SidebarToggle mode="dismiss" onDismiss={() => setDrawerOpen(false)} />
							) : undefined
						}
					/>
				</SidebarHeader>
				<SidebarNav aria-label="Dashboard navigation">
					<SidebarItem active onClick={() => setDrawerOpen(false)}>
						<LayoutDashboard /> Overview
					</SidebarItem>
					<SidebarItem
						onClick={() => {
							setDrawerOpen(false);
							document.getElementById("account-list")?.scrollIntoView();
						}}
					>
						<Users /> Accounts
					</SidebarItem>
				</SidebarNav>
			</Sidebar>
		);
	}
	return (
		<SidebarProvider>
			<AppShell layout="responsive">
				<AppSkipLink>Skip to content</AppSkipLink>
				<div id="exec-sidebar" className="hidden md:block">
					{sidebar(false)}
				</div>
				<SidebarDrawer
					id="dashboard-navigation"
					returnFocusRef={navigationTrigger}
					open={drawerOpen}
					onOpenChange={setDrawerOpen}
					title="Dashboard navigation"
				>
					{sidebar(true)}
				</SidebarDrawer>
				<AppMain>
					<AppHeader
						title={EXECUTIVE_CONFIG.headerTitle}
						leading={
							mobile && (
								<AppHeaderMenuButton
									ref={navigationTrigger}
									onClick={() => setDrawerOpen(true)}
									aria-expanded={drawerOpen}
									aria-controls="dashboard-navigation"
								/>
							)
						}
					/>
					<ContentIsland className="overflow-auto">
						<div className="space-y-basalt-layout-lg">
							<div id="exec-kpis" className="space-y-basalt-layout-lg">
								<PageHeader
									title={EXECUTIVE_CONFIG.title}
									description={EXECUTIVE_CONFIG.description}
								/>
								<StatGrid columns={4}>
									<StatCard
										title="Revenue"
										value="$482k"
										subtitle="This quarter"
										trend={{ value: 8.2, label: "vs. last quarter" }}
									/>
									<StatCard title="Active accounts" value="128" subtitle="Across all regions" />
									<StatCard title="Retention" value="96.4%" subtitle="Trailing 12 months" />
									<StatCard title="Open orders" value="42" subtitle="Awaiting fulfillment" />
								</StatGrid>
							</div>
							<div id="exec-capacity" className="grid gap-basalt-layout sm:grid-cols-2">
								<LayerCard padding="none">
									<LayerCard.Header>Capacity</LayerCard.Header>
									<LayerCard.Body className="space-y-basalt-card">
										<Meter label="Team utilization" value={68} />
										<Meter label="Delivery capacity" value={54} />
										<Meter label="Support coverage" value={81} />
									</LayerCard.Body>
								</LayerCard>
								<LayerCard padding="none">
									<LayerCard.Header>Channel mix</LayerCard.Header>
									<LayerCard.Body className="space-y-basalt-card">
										<Meter label="Direct" value={48} />
										<Meter label="Partners" value={32} />
										<Meter label="Self-service" value={20} />
									</LayerCard.Body>
								</LayerCard>
							</div>
							<LayerCard id="account-list" padding="none">
								<LayerCard.Header divided className="flex-wrap">
									<span>Accounts</span>
									<Input
										aria-label="Filter accounts"
										placeholder="Filter accounts"
										value={filter}
										onChange={(event) => setFilter(event.target.value)}
									/>
								</LayerCard.Header>
								<DataTable
									data={ACCOUNTS}
									columns={COLUMNS}
									filter={filter}
									getRowId={(row) => row.name}
									edge="attached"
								/>
							</LayerCard>
						</div>
					</ContentIsland>
				</AppMain>
			</AppShell>
		</SidebarProvider>
	);
}
```
