Create a New Page

This guide walks you through the steps to create a new page in the template. By leveraging Next.js file-system routing and the extended routing configuration, you can easily add new pages with tailored settings.

Create the Page Component
1. Navigate to the app directory
  • In the src/app folder, decide where your new page should go. For example, if the page requires layouts, place it in the src/app/(layout) directory. If it doesn't require layouts, use the src/app/(non-layout) directory instead.
2. Create a New File
  • For a static route, create src/app/product/page.tsx
  • For a dynamic route, use brackets to define parameters, e.g.,src/app/product/[id]/page.tsx
3. Add Your Page Code

Define the React component for your page. Example:

const Page = () => {
  return (
     

Welcome to the New Page

This is a custom page.

); }; export default Page;
Additional Notes

Instead of applying 'use client' directly to the page file, it is recommended to create a separate client component and import it into the page. This approach allows the page itself to remain server-rendered, optimizing server-side rendering (SSR) and letting only the client-side logic be handled in the client component. For example:

// src/app/(layout)/new-page/page.tsx
import ClientComponent from './ClientComponent';

const NewPage = () => {
  return (
      

New Page

<ClientComponent />
); }; export default NewPage;
// src/app/(layout)/new-page/_components/ClientComponent.tsx
'use client';

const ClientComponent = () => {
  return 

This component runs on the client.

; }; export default ClientComponent;
Receive the latest updates directly in your inbox!

Be the first to know about new updates and exclusive discounts. No spam, just great offers!

How about

A Custom Project?

With over 7 years of experienced team, we specialize in delivering custom projects for startups, blue-chip companies, and government agencies. We have successfully completed over 250+ projects, providing tailored solutions that meet the unique needs of each client.

Hire Us
Domiex Admin & Dashboards
230+

Total Pages

5+

Layouts

11+

Application

We provide quick support withing one business day to all of our customers.

© Domiex Created & Crafted by SRBThemes.