New Page
How to Create a New Page
-
Create a new page file:
Add a new file atsrc/app/your-page-name/page.tsx. -
Add your page content:
Example:import React from "react"; export default function YourPage() { return ( <div className="page-content"> <h1>Your Page Title</h1> <p>This is your new page content.</p> </div> ); } -
Optional: Dynamic route example
To create a dynamic route at/products/[id], createsrc/app/products/[id]/page.tsxwith:type PageProps = { params: { id: string } }; export default function ProductDetailPage({ params }: PageProps) { return ( <div className="page-content"> <h1>Product {params.id}</h1> <p>Render product details for ID: {params.id}</p> </div> ); } -
Add to navigation (optional):
To show your page in the sidebar or menu, update the menu config file (e.g.,src/constants/layout.ts) and add your page link.
That's it! Your new page will be available at /your-page-name.