Skip to main content

Routes

DashboardRouteDefinition

Defines a custom route for the dashboard with optional navigation menu integration.

Signature
interface DashboardRouteDefinition {
component: (route: AnyRoute) => React.ReactNode;
path: string;
navMenuItem?: Partial<NavMenuItem> & { sectionId: string };
loader?: RouteOptions['loader'];
}

component

property
(route: AnyRoute) => React.ReactNode

The React component that will be rendered for this route.

path

property
string

The URL path for this route, e.g. '/my-custom-page'.

property
Partial<NavMenuItem> & { sectionId: string }

Optional navigation menu item configuration to add this route to the nav menu on the left side of the dashboard.

loader

property
RouteOptions['loader']

Optional loader function to fetch data before the route renders. The value is a Tanstack Router loader function