Routing & Pages

To add new screens (pages) to your custom application:

1

Create the View

Navigate to web/src/views and create your component (e.g., MyPage.tsx).

REACT
const MyPage = () => {
    return <div className="p-4">My Custom Page Content</div>;
};
export default MyPage;
2

Import the View

Open web/src/routes/index.tsx and import your component.

REACT
import MyPage from "@/views/MyPage";
3

Register the Route

Add your route to the AppRoutes array.

REACT
export const AppRoutes: RouteType[] = [
    {
        path: '/',
        element: <Homepage />,
        className: "bg-white",
    },
    {
        path: '/my-new-page',
        element: <MyPage />,
        className: "bg-gray-100", // Optional wrapper class
    }
];

Last updated