Why use AppShell’s exports?
AppShell has its ownRouterProvider instance. Using components and hooks from @tailor-platform/app-shell ensures they connect to the correct router context.
Navigation hooks
AppShell re-exports these essential React Router hooks:Navigation components
Basic usage
Programmatic navigation
Link component
Search parameters
Manipulate query strings withuseSearchParams:
Command palette
TheCommandPalette component provides keyboard-driven quick navigation to any page in your application.
Features
- Keyboard shortcut:
Cmd+K(Mac) orCtrl+K(Windows/Linux) - Fuzzy search: Find pages by title or path
- Hierarchical display: Shows module > resource breadcrumbs
- Keyboard navigation: Arrow keys and Enter to navigate
- Multilingual: Supports English and Japanese locales
- Smart filtering: Respects access control (hidden routes don’t appear)
Setup
Add theCommandPalette to your AppShell layout:
How it works
The CommandPalette automatically:- Collects all navigable routes from your module definitions
- Respects guard functions (routes with
hidden()won’t appear) - Updates when navigation items change
- Adapts to the current locale
No additional configuration needed—just add the component and it works!
User experience
1
Open command palette
User presses
Cmd+K or Ctrl+K anywhere in the app2
Search for pages
Dialog opens with fuzzy search. Type to filter (e.g., “order detail”)
3
Navigate results
Use arrow keys to navigate through results
4
Navigate to page
Press Enter to navigate to the selected page
Type-safe navigation
When using file-based routing with the Vite plugin, you can enable automatic generation of type-safe route helpers.Enable typed routes
Configure in your Vite config:Generated file
The plugin generatessrc/routes.generated.ts:
Usage with TypeScript
Benefits
Compile-time safety
TypeScript catches invalid routes and missing parameters before runtime
Auto-completion
IDE autocomplete for all routes and their required parameters
Refactoring support
Rename routes and parameters with confidence
Opt-in design
Use only when needed—manual path strings still work
Opt-in design
Typed routes are completely optional. WithoutgenerateTypedRoutes, you can continue building paths dynamically:
HMR support
The generated file automatically updates when:- A new
page.tsxis added - A
page.tsxis deleted - The dev server starts
The file regenerates automatically during development, so your types always stay in sync with your routes.
Related
File-based routing
Define routes using directory structure
Modules and resources
Understand AppShell’s routing architecture