The Admin Shell recipe provides a copy-pasteable scaffold for building admin dashboards and back-office applications. It composes existing design system components — saas-sidebar-layout.tsx, screen-shell.tsx, global-search-bar.tsx — into a complete application shell with resource navigation, authentication guard, notification integration, and global search. The recipe ships as a runnable example with stories and tests that developers clone and customize for their domain.
Goals
Provide a complete, copy-pasteable admin shell scaffold using existing design system components.
Demonstrate resource navigation with sidebar sections, nested items, and active-state highlighting.
Show an authentication guard pattern that redirects unauthenticated users.
A complete starting point they can copy and extend
Designers
Team members reviewing admin UX consistency
A documented pattern for consistent admin shells
New team members
Engineers onboarding to admin projects
A working example showing how to compose layout components
Pain Points
User
Pain Point
Impact
Application developers
Building an admin shell from scratch each time, composing sidebar, header, auth, and navigation
Wasted time; inconsistent admin UX across products
Application developers
No documented pattern for auth guards in the design system context
Auth integration is done differently in each admin app
Application developers
Unclear how to integrate global search, notifications, and breadcrumbs with the layout
Features are added ad hoc with inconsistent placement
Definitions
Term
Definition
Admin shell
The outer application frame: sidebar, header, content area, and supporting features (search, notifications, auth)
Resource navigation
Sidebar menu items organized by domain (e.g., Users, Products, Settings) with nesting and active states
Auth guard
A route wrapper that checks authentication state and redirects unauthenticated users to a login page
Notification center
A header element showing unread notification count with a dropdown listing recent notifications
Scaffold
A copy-pasteable starting point that developers customize for their specific application
Current State
Existing Behavior
saas-sidebar-layout.tsx provides a sidebar + content layout frame. screen-shell.tsx provides a content-area shell with header and body sections. global-search-bar.tsx provides a search input with keyboard shortcut. These exist as standalone components without a documented composition pattern for admin applications.
Current Limitations
No recipe showing how to compose these components into a complete admin shell.
No auth guard pattern documented.
No notification integration pattern.
No resource navigation example with grouped sections and active states.
No breadcrumb integration pattern.
Existing Workarounds
Developers study existing admin applications or build from scratch.
Each admin app composes the layout components differently.
Auth guards and notification integration are implemented ad hoc.
Proposed Solution
Summary
Create a recipe folder (src/recipes/admin-shell/) containing a composed admin shell, mock auth and notification services, navigation configuration, and documentation. Ship with Storybook stories demonstrating authenticated, unauthenticated, and various navigation states.
Key Capabilities
AdminShell component composing SaasSidebarLayout, ScreenShell, header bar, and sidebar navigation.
AdminNav configuration type for defining sidebar sections with icons, labels, paths, and nested items.
AuthGuard component that wraps routes and redirects unauthenticated users.
NotificationCenter header element with unread count badge and dropdown.
UserMenu avatar dropdown with profile, settings, and logout actions.
AdminBreadcrumbs route-aware breadcrumb trail.
Mock auth service (useAuth) and mock notification service (useNotifications).
Global search integrated into the header via GlobalSearchBar.
User Experience
Developers browse the recipe in Storybook, see the complete admin shell with navigation, search, notifications, and breadcrumbs. They copy the recipe, replace mock services with real ones, and customize the navigation configuration for their domain.
Developer Experience
The recipe is a self-contained folder. Navigation is defined as a typed configuration object. The auth guard is a wrapper component. Services are injected via React context so mocking is straightforward. Stories show authenticated/unauthenticated states, different navigation configurations, and responsive behavior.
Requirements
ID
Requirement
Priority
Notes
FR-001
The recipe must compose SaasSidebarLayout and ScreenShell
Must
Existing components
FR-002
The recipe must show resource navigation with sections, icons, and active states
Must
Core admin UX
FR-003
The recipe must include an auth guard pattern
Must
Security baseline
FR-004
The recipe must include notification integration
Must
Common admin feature
FR-005
The recipe must include global search in the header
Must
Uses GlobalSearchBar
FR-006
The recipe must include a user menu
Must
Profile, settings, logout
FR-007
The recipe must show responsive sidebar collapse
Must
Mobile support
FR-008
The recipe should include breadcrumbs
Should
Navigation context
FR-009
The recipe must ship with stories
Must
Visual reference
FR-010
The recipe must ship with tests
Must
Quality gate
Priority Definitions
Priority
Meaning
Must
Required for this feature to ship.
Should
Important, but can be deferred if needed.
Could
Nice to have. Not required for initial release.
Functional Requirements
ID
Requirement
User Benefit
Priority
FUNC-001
Sidebar renders navigation sections from a typed configuration array
Declarative navigation definition
Must
FUNC-002
Each nav item shows an icon, label, and optional badge (e.g., unread count)
Clear visual hierarchy
Must
FUNC-003
Nested nav items expand/collapse on parent click
Organized deep navigation
Must
FUNC-004
Active nav item is highlighted based on the current route
Wayfinding
Must
FUNC-005
AuthGuard checks auth state on mount and redirects to /login if unauthenticated
Route protection
Must
FUNC-006
AuthGuard shows a loading state while checking auth
Prevents flash of wrong content
Must
FUNC-007
NotificationCenter shows unread count badge in the header
Quick notification visibility
Must
FUNC-008
NotificationCenter dropdown lists recent notifications with timestamp and dismiss action
Notification management
Must
FUNC-009
UserMenu shows avatar, name, and dropdown with profile, settings, and logout
Account management
Must
FUNC-010
On mobile (below breakpoint), sidebar collapses to a hamburger toggle
Responsive layout
Must
FUNC-011
Breadcrumbs show the current route hierarchy below the header
Navigation context
Should
FUNC-012
GlobalSearchBar in the header opens with Cmd+K / Ctrl+K keyboard shortcut
Quick search access
Must
Non-Functional Requirements
ID
Requirement
Category
Priority
NFR-001
Recipe code must be copy-pasteable and self-contained
Maintainability
Must
NFR-002
All recipe code must pass TypeScript strict mode
Correctness
Must
NFR-003
Stories must render in light and dark themes
Compatibility
Must
NFR-004
Auth guard must not flash protected content before redirect
Security
Must
NFR-005
Sidebar collapse/expand must not cause layout shift in the content area
Performance
Must
NFR-006
Navigation configuration must support at least 3 levels of nesting
Flexibility
Should
API / Interface Requirements
Public API
This is a recipe, not a published package. No new public API is exported from the design system.
Name
Type
Description
Required
Recipe folder
source
src/recipes/admin-shell/ with components, config types, and services