Creates a top-level module that appears in the main navigation. Modules contain resources and can optionally have their own landing page.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/tailor-platform/app-shell/llms.txt
Use this file to discover all available pages before exploring further.
Signature
Parameters
URL path for the module.
Landing page component. Optional - if omitted, module redirects to first resource.Receives
ResourceComponentProps:title: string- Title of the resourceicon?: ReactNode- Optional iconresources?: Resource[]- Optional sub-resources
Array of resources within this module. Define using
defineResource().Array of guard functions to control access. Guards are executed in order. If any guard returns non-pass result, access is denied.See Route Guards for details.
Error boundary component for this module and its child resources. When an error occurs in this module or its resources, this component will render.Use the
useRouteError hook to access error details within the component.Return Type
A module object that can be passed to the
modules prop of AppShell.Examples
Basic Module with Component
Module Without Component (Auto-redirect)
Module with Guards
Module with Redirect Guard
Module with Custom Error Boundary
Module with Internationalization
Notes
- If a module has no
componentand noguards, an error will be thrown - Modules without a component must use
guardswithredirectTo()orhidden()to control access - A guard that only returns
pass()without a component will result in a blank page - Guards are executed in the loader phase before the component renders
- Child resources inherit the module’s error boundary unless they define their own
Related
- defineResource - Define resources within modules
- Route Guards - Control access to routes
- defineI18nLabels - Internationalization for titles