Overview
TheAppShell component is the root-level provider component for Tailor Platform applications. It manages application-wide context including navigation configuration, theme, authentication state, and custom context data.
This component should be mounted at the root of your application (catch-all segment in Next.js App Router, or root in Vite/React apps).
Props
string
App shell title displayed in the sidebar header
React.ReactNode
App shell icon displayed in the sidebar header
string
Base path for the app shell routing
Module[]
Navigation configuration created with
defineModule(). When using the vite-plugin, this is automatically set via AppShell.WithPages().() => React.ReactNode
A component to be rendered at the root level of AppShell (path=”/”). Use guards with
redirectTo() for redirects.Resource[]
Settings resources that appear only in the Settings menu
string
Locale code for built-in UI strings (e.g., “en”, “ja”, “fr”). Built-in translations available for “en” and “ja” only. Auto-detects from browser preferences if not provided, defaults to “en” if no browser locale is available.
React.ReactNode
Global error boundary component applied to all routes. When an error occurs in any route component, this component will render. Module and resource-level error boundaries take precedence over this.Use the
useRouteError hook to access error details within the component.ContextData
Custom context data accessible from guards and components. Use module augmentation to define the type of context data.
React.ReactNode
Layout components like
SidebarLayoutRoute Configuration
Routes can be configured in two ways:1. Automatic (Recommended)
Use the vite-plugin which automatically configures pages viaAppShell.WithPages():
2. Explicit Modules
Pass themodules prop for manual configuration:
Usage Examples
Basic Setup
With Custom Icon and Locale
With Context Data
With Root Component
With Error Boundary
Complete Configuration
Context Access
Access AppShell context in your components using the provided hooks:TypeScript
AppShellProps Type
Context Data Type Augmentation
See Also
- SidebarLayout - Default layout with sidebar navigation
- CommandPalette - Quick navigation component
- defineModule - Create navigation modules
- defineResource - Create pages and resources