Defines a resource that can be nested within modules or other resources. Resources represent individual pages or features in your application.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 resource. Supports dynamic segments using colon prefix (e.g.,
:id, :productSlug).Component to render when this resource is active.Receives
ResourceComponentProps:title: string- Title of the resourceicon?: ReactNode- Optional iconresources?: Resource[]- Optional sub-resources
Metadata configuration for the resource.
Display title used in navigation and breadcrumbs. Defaults to path in capital case.
Icon displayed in navigation.
Custom breadcrumb segment title. Can be a static string or a function that takes the path segment and returns a title.
Nested resources under this resource. 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 resource and its sub-resources. Overrides module-level or global error boundaries.Use the
useRouteError hook to access error details within the component.Return Type
A resource object that can be used in a module’s
resources array or another resource’s subResources array.Examples
Basic Resource
Resource with Metadata
Resource with Dynamic Segments
Nested Resources (Sub-resources)
Resource with Guards
Resource with Error Boundary
Resource with Internationalization
Usage in Modules
Notes
- The
componentprop is required for resources (unlike modules where it’s optional) - Sub-resources do not appear in the sidebar navigation but are accessible via routing and appear in breadcrumbs
- Dynamic path segments (
:paramName) are accessible in the component usinguseParams()fromreact-router - Resources inherit the module’s error boundary unless they define their own
- Guards are executed before the component renders during the loader phase
Related
- defineModule - Define top-level modules
- Route Guards - Control access to resources
- defineI18nLabels - Internationalization for titles