What You’ll Build
A multi-page dashboard with:- A dashboard home page
- An orders list page
- Order detail pages with dynamic routing
- Settings page
- Automatic sidebar navigation
Prerequisites
Before starting, make sure you have:- Node.js 18+ installed
- Basic knowledge of React and TypeScript
- A React project set up (Next.js or Vite)
Installation
1
Install App Shell
Install the package from npm:Or with other package managers:
2
Create Your Module Structure
Define your application modules and resources. Create a file called
modules.tsx:3
Set Up AppShell Component
Create your main App component with
AppShell and SidebarLayout:The
SidebarLayout component automatically generates navigation from your modules. No additional configuration needed!4
Add the App to Your Entry Point
For Vite, update your For Next.js, update your
main.tsx:app/layout.tsx:Adding Nested Pages
Now let’s add more pages to make your app functional.1
Create an Orders List Page
Add a resource to the dashboard module:
2
Add Dynamic Routes for Order Details
Create a detail page with a dynamic
:id parameter:3
Connect Resources to Module
Update your dashboard module to include the orders resource with its nested detail page:
Adding Navigation Links
Make your pages interactive with theLink component:
Testing Your Application
Start your development server:- A sidebar with “Dashboard” and “Settings” modules
- Clicking “Dashboard” shows your home page
- “Orders” appears under Dashboard in the sidebar
- Clicking an order navigates to the detail page
- The URL updates to reflect the current page
Next Steps
Now that you have a working app, explore these guides:- Custom Layouts - Learn about the Layout component for complex page structures
- Guards & Permissions - Add access control to your pages
- Internationalization - Support multiple languages
Common Patterns
Module Without a Landing Page
If you don’t need a landing page for a module, use a guard to redirect:Using Data from Context
Pass data to all pages viacontextData: