Rasengan Logo
Rasengan Logo
  • Docs
  • Blog
  • Showcase
  • Support us
Using stable versionv1.2.0
Documentation
Packages
Templates
Rasengan UI Kit
Using stable versionv1.2.0
Documentation
Packages
Templates
Rasengan UI Kit

API REFERENCE

Define Routes Group

defineRoutesGroup() is an utility function that allows you to create a routes group by attaching pages under a same path.


Imagine you have multiple pages that share the same path, you can use this function to group them together.

Usage

admin.group.ts
tsximport { defineRoutesGroup } from "rasengan"; import Dashboard from "@/app/admin/dashboard.page"; import Users from "@/app/admin/users.page"; import Settings from "@/app/admin/settings.page"; import Profile from "@/app/admin/profile.page"; export default defineRoutesGroup({ path: "/admin", children: [ Dashboard, Users, Settings, Profile, ] });

As you can see, all the pages are grouped under the same path. This group can be easily imported in your router.

app.router.ts
tsximport { RouterComponent, defineRouter } from "rasengan"; import AdminGroup from "@/app/admin.group"; class AppRouter extends RouterComponent {} export default defineRouter({ pages: [AdminGroup], })(AppRouter);

Options

defineRoutesGroup() accepts an object with the following properties:

OptionTypeDescriptionOptional
pathstringThe path of the routes groupNo
childrenPageComponent[] | MDXPageComponent[]The pages to be grouped under the same pathNo
defineRoutesGroup
defintStaticPaths

ON THIS PAGE

Usage
Options
Rasengan Logo
Rasengan Logo

Resources

  • Docs
  • Packages
  • Blog
  • Showcase
  • Support us

Community

  • Github
  • X (Twitter)

Subscribe to the Newsletter

Stay informed to the news about rasengan.js including new releases, events, etc...

© 2024-2026 Rasengan Labs, All rights reserved.