Navigation System
Type-safe routing configuration, providing a flexible and maintainable way to handle navigation in your application.
The Boring Template implements a type-safe routing system that ensures consistency and maintainability throughout your application.
Key Features
Type-Safe Routes
🔒 Fully typed route definitions and parameters
Active State
Dynamic Paths
Responsive
Route Configuration
Routes are defined in a type-safe configuration object that includes metadata, paths, and additional information for each route.
Using typed route configurations ensures that navigation links are consistent and helps prevent broken links.
Navigation Components
AppSidebar
The AppSidebar component provides a hierarchical navigation structure with categories and items.
NavMain
The NavMain component renders navigation items with icons and active states.
Responsive Navigation
All navigation components are designed to be responsive, adapting to different screen sizes and device types.
Route Helpers
createRoute
redirectToRoute
isRouteActive
createRoute
Creates a type-safe route with parameters:
redirectToRoute
Redirects to a route with proper typing:
isRouteActive
Determines if a route is currently active:
Best Practices
Route Definition
- Use type-safe route names
- Include proper metadata
- Define clear path patterns
- Document route parameters
Navigation Usage
- Leverage type checking
- Use helper functions
- Handle loading states
- Implement proper active states
Usage Example
Here's a complete example of implementing navigation in a dashboard layout:
Always use the provided route helper functions instead of hardcoding URLs to ensure type safety and maintainability.