Compose sidebar, header, breadcrumbs, settings, auth split, and content layouts.
The layout shell exports build on ui Shell and Sidebar primitives. Use them when a route needs persistent app chrome; keep business logic and data fetching in the host app.
Composition model
DashboardShell
├── SidebarProvider (from ui)
│ ├── DashboardHeader → Breadcrumbs + actions (theme, etc.)
│ ├── Sidebar → brand, DashboardSidebarNav, DashboardAccountMenu
│ └── Shell.Main → your page (tables, forms, settings)
TopNavShell → header + optional horizontal nav (no sidebar)
AuthSplitShell → auth column + marketing aside
SettingsLayout → secondary nav inside mainInstallation
Registry CLI
Requires a one-time components.json registry entry for @feature-kit/dashboard-shell.
pnpm dlx shadcn@latest add https://feature-kits.vercel.app/r/dashboard-shell.jsonNamespaced: npx shadcn@latest add @feature-kit/dashboard-shell
Manual installation
Monorepo consumers can depend on workspace:* packages instead of the registry CLI.
pnpm add layout theme uiDependencies
// apps/your-app/package.json
"dependencies": {
"layout": "workspace:*"
"theme": "workspace:*"
"ui": "workspace:*"
}Transpile (Next.js)
// next.config.ts
transpilePackages: ["layout", "theme", "ui"]Import
import {
DashboardShell,
DashboardSidebarNav,
DashboardAccountMenu,
ContentPageHeader,
} from "@/lib/feature-kit/shell"Install @feature-kit/layout and @feature-kit/breadcrumb when not using the dashboard-shell bundle alone.
Scenarios
Each scenario has a live preview under Layout examples.
Basic dashboard
Icon-only sidebar
Pass defaultSidebarOpen={false} so the rail starts collapsed. Users expand via the trigger or ⌘/Ctrl+B.
Nested nav groups
Use DashboardSidebarNav groups with SidebarFlatNavGroup for collapsible sections. Active items follow the current pathname.
Mobile sheet navigation
The ui sidebar renders a sheet on small viewports. No extra wiring — use DashboardHeader with SidebarTrigger.
Account menu (signed-in user)
Pass user from useSession() into DashboardAccountMenu. Add SignOutDropdownMenuItem from auth.
Top nav only
Auth split layout
Feature Kits
Split auth layout for sign-in flows. The aside is hidden on small screens.
Settings with secondary nav
Content layouts (grid, flex, form section)
Skeleton / loading
Swap DashboardSidebarNav for DashboardSidebarNavSkeleton while nav config loads.
Data table + theme in header
API reference
DashboardShell
| Prop | Type | Default | Description |
|---|---|---|---|
| children | ReactNode | — | Main column content. |
| sidebarHeader | ReactNode | — | Brand row inside SidebarHeader. |
| sidebarContent | ReactNode | — | Typically DashboardSidebarNav. |
| sidebarFooter | ReactNode | — | Account menu or sign-in CTA. |
| headerActions | ReactNode | — | Right side of header (ThemeSelector, etc.). |
| defaultSidebarOpen | boolean | true | Initial expanded state. |
| showSidebar | boolean | true | When false, renders TopNavShell. |
| sidebarCollapsible | "offcanvas" | "icon" | "none" | "icon" | Passed to ui Sidebar. |
| showBreadcrumbs | boolean | true | Route breadcrumbs in header. |
| topNavigation | ReactNode | — | Horizontal links under header when sidebar hidden. |
DashboardHeader
| Prop | Type | Default | Description |
|---|---|---|---|
| actions | ReactNode | — | Trailing actions. |
| showBreadcrumbs | boolean | true | |
| showSidebarTrigger | boolean | true | Hide for TopNavShell. |
DashboardSidebarNav
| Prop | Type | Default | Description |
|---|---|---|---|
| groups | DashboardNavGroup[] | — | Collapsible labeled sections. |
| links | DashboardNavLink[] | — | Flat list alternative to groups. |
DashboardAccountMenu
| Prop | Type | Default | Description |
|---|---|---|---|
| user | { name, email, image? } | — | Displayed identity. |
| menuItems | ReactNode | — | Extra dropdown items. |
| signOutItem | ReactNode | — | e.g. SignOutDropdownMenuItem. |
TopNavShell, SettingsLayout, AuthSplitShell, ContentPageHeader
| Component | Role |
|---|---|
TopNavShell | Header + main without sidebar |
SettingsLayout | Title + vertical section nav + panel |
AuthSplitShell | Two-column auth/marketing |
ContentPageHeader | Page title, description, actions row |
DashboardSidebarNavSkeleton | Sidebar placeholder groups |
Related
- Layout package — breadcrumbs, form sections, dialogs
- Theme —
ThemeSelectorinheaderActions - Data table — listing inside the shell body