Core concepts
Both modules and resources share a common interface with these key properties:path- The URL segment for this pagecomponent- The React component to render when navigating to this routeguards- Optional access control functions based on permissions or feature flagsmeta- Metadata like title and icon for navigation
Modules vs resources
Basic example
Here’s a simple application structure with two modules:URL structure
The hierarchy directly maps to URLs:Sub-resources (like
:id) don’t appear in the sidebar navigation but are accessible via direct links and will show in breadcrumbs.Modules without components
Modules can omit thecomponent property to automatically redirect to their first resource:
/dashboard automatically redirects to /dashboard/overview.
Dynamic parameters
Use React Router’s:param syntax for dynamic URL segments:
Route guards
Guards control access to modules and resources based on custom logic. They execute in order and provide semantic results:pass(), hidden(), or redirectTo().
Permission-based access
Feature flag based
Redirect to login
Reusable guards
Create composable guards for complex access logic:Guards are executed in order. The first non-
pass() result stops execution and determines the access outcome.Guard behavior
When a module or resource is hidden via guards:- It won’t appear in navigation menus
- It won’t be accessible via direct URL navigation (shows 404)
- It won’t appear in CommandPalette search results
Component props
Both module and resource components receive props from AppShell:Error boundaries
Define custom error handling at the module or resource level:Resource-level error boundaries override module-level boundaries, which override the global error boundary set in
<AppShell>.Related
Routing and navigation
Learn about client-side navigation and route helpers
File-based routing
Use directory structure instead of explicit definitions