New Page

How to Create a New Page

  1. Create a new page file:
    Add a new file at src/app/your-page-name/page.tsx.
  2. 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>
      );
    }
    
  3. Optional: Dynamic route example
    To create a dynamic route at /products/[id], create src/app/products/[id]/page.tsx with:
    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>
      );
    }
    
  4. 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.

© Velzon.
Design & Develop by Themesbrand