Rasengan Logo
Rasengan Logo
  • Docs
  • Blog
  • Showcase
Using stable versionv1.2.1
Documentation
Packages
Templates
Rasengan UI Kit
Using stable versionv1.2.1
Documentation
Packages
Templates
Rasengan UI Kit

CORE CONCEPTS

Defining Routes

In Rasengan.js, each page is defined as a PageComponent. A page consists of a function returning a JSX element and includes metadata such as title, description, and keywords to improve SEO and page accessibility.

Define a Page

To define a page, create a new .page.tsx or .page.jsx file inside the app folder. Then, specify the page’s path and metadata.

Let's assume you are creating an About page accessible at /about. Below is how you can define it:

TypeScript
JavaScript
src/app/about.page.tsx
import { PageComponent } from "rasengan"; const About: PageComponent = () => { return ( <div>About us</div> ); }; About.path = "/about"; About.metadata = { title: "About Us", description: "Learn more about our company", }; export default About;

Attach to a router

To attach a page to a router, import the page and attach it to the router.

src/app/app.router.tsx
import { RouterComponent, defineRouter } from "rasengan"; import About from "@/app/about.page"; class AppRouter extends RouterComponent {} export default defineRouter({ pages: [About], //... })(AppRouter);

Now when you visit /about, you will see the About page.

Understanding Metadata

Metadata helps search engines and social media platforms understand your page content.

PropertyTypeDescription
titlestringThe title of the page
descriptionstringA short description of the page
Learn more about metadata
Details
Router
Layouts

On This Page

  • Define a Page
    • Attach to a router
  • Understanding Metadata

Discover Plus Ultra ✨

A stunning and well crafted Portfolio website to showcase your work in a nice way.

Rasengan Logo
Rasengan Logo

Resources

  • Docs
  • Packages
  • Blog
  • Showcase
  • Support us

Products

  • Rasengan UI
  • Rasengan Hub
  • Chidori
  • Nindo
  • Chunin

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.