Simplr Router logo Simplr Router Docs Guides Toggle darkmode

API: Route

Type name: SimplrRoute

NameTypeDescription
pathstringThe URL path for the route
componentstringThe view component name for the route
namestringName of the view route
importFunctionAn import function for lazy loading. e.g. () => import("./my-view.js")
guardFunctionA guard function to check view access
routesSimplrRoute[]An array of subroutes that inherit paths from the parent route
slots[x: string]: string | FunctionAn array of slots to append to the view component
pattern[x: string]: string |RegExp pattern to match dynamic route keys
redirectstring | { name: string }Path to redirect to
preventUnloadbooleanIf the router should intercept navigation from this page with a confirmation dialog
properties[x: string]: stringProperties to pass to the view.