Navigation
The sidebar, the top-nav menus, the phone menu and the ⌘K "Pages" list all
come from one file: config/nav.ts. Edit it once and every menu follows.
1. The structure
export const nav: NavGroup[] = [
{
label: "Dashboards", // small heading above the group
items: [
{ label: "Analytics", href: "/", icon: "home" },
{ label: "eCommerce", href: "/dashboards/ecommerce", icon: "cart" },
],
},
// more groups…
]
Item options
| Option | Type | What it does |
|---|---|---|
label |
string | Text in menus and ⌘K |
href |
string | Where it goes, e.g. "/apps/kanban" |
icon |
icon name | See "Icons" below |
badge |
string | Small pill on the right, e.g. unread count "12" or "New" |
hidden |
boolean | Hide from menus; the page still works and stays in ⌘K… unless also removed from routes |
app |
app id | Hides the item when that app is off in siteConfig.apps |
children |
items | A fold-out sub-menu (like Auth and Errors) |
2. Common changes
Rename an item: change label.
Reorder: move the line up or down. Move whole groups the same way.
Remove an item: delete its line (the page still exists at its URL). To remove the page completely, also follow "Removing a page" in Adding a page.
Hide an item but keep the page: hidden: true.
Add a group:
{ label: "Reports", items: [{ label: "Revenue", href: "/reports/revenue", icon: "chart" }] },
A group with no heading: use label: "".
Fold-out menu:
{
label: "Auth",
href: "/auth",
icon: "lock",
children: [
{ label: "Sign in", href: "/sign-in", icon: "lock" },
{ label: "Sign up", href: "/sign-up", icon: "lock" },
],
},
When the sidebar is collapsed, fold-outs open as a small menu to the right.
Badges from live data. badge is static text. To show a live count,
compute it where the sidebar renders. For example, in sidebar.tsx, look the
count up with useQuery and pass it in place of item.badge.
3. Turn whole apps off
In config/site.config.ts:
apps: { kanban: true, calendar: true, chat: false, mail: false, invoices: true, users: true, files: true },
Turning an app off:
- removes its items (those with
app: "chat") from every menu and from ⌘K; - makes its pages show the 404 (
/apps/chatand anything under it), in both the Next.js and the Vite version; - hides its results on the Search page (people for Users, invoices, mail, files, tasks for Kanban).
The code stays in the project, so turning it back on is one word. To remove
an app for good, also delete its page files and its line in routes.ts.
Pages are tied to an app by their address: anything under /apps/<id>/ uses
the <id> switch. If you add your own app, add its id to AppId and apps
in site.config.ts and run pnpm routes:sync (Next.js).
4. Icons
Icons are named in nav.ts and mapped to Lucide icons
in layout/icons.tsx:
export const ICONS: Record<IconName, LucideIcon> = {
home: House,
cart: ShoppingCart,
// …
}
Use a new icon:
- Find it on lucide.dev, e.g. "ChartPie".
- In
layout/icons.tsx, import it and add a name:import { ChartPie } from "lucide-react"→chart: ChartPie, - Add the name to the
IconNametype inconfig/nav.ts:| "chart". - Use it:
icon: "chart".
5. Active item
An item is highlighted when the current URL is its href or starts with it.
/apps/users/u_002 highlights "Users". The home item (/) only matches the
home page exactly. The highlight slides between items. It respects reduced
motion, like every animation.
6. Breadcrumbs
Breadcrumbs come from config/routes.ts, not from nav.ts: section › page,
or section › parent › page for detail pages. For example,
Apps › Invoices › Invoice. See Adding a page.