# New Menu

### Add a New menu/route in the main layout

{% tabs %}
{% tab title="VITE (TS)" %}

1. To add one more menu item in **`<MainRoutes />`**&#x55;pdate the following file at the same location **`src\routes\MainRoutes.tsx`**

{% code title="MainRoutes.tsx" %}

```typescript
...
...
const SamplePage = Loadable(lazy(() => import('views/sample-page')));
// import new view and save it in constant. for e.g
const NewMenu = Loadable(lazy(() => import('views/new-menu')));

const MainRoutes = {
    path: '/',
    element: (
        <AuthGuard>
            <MainLayout />
        </AuthGuard>
    ),
    children: [
        {
            path: '/sample-page',
            element: <SamplePage />
        },
        {
            path: '/newmenu',
            element: <NewMenu />
        }
    ]
};

export default MainRoutes;
```

{% endcode %}

{% hint style="warning" %}
Any route added in **`<MainLayout>`** will automatically go through **\<AuthGuard>**
{% endhint %}
{% endtab %}

{% tab title="VITE (JS)" %}

1. To add one more menu item in **`<MainRoutes />`**&#x55;pdate the following file at the same location **`src\routes\MainRoutes.tsx`**

{% code title="MainRoutes.tsx" %}

```typescript
...
...
const SamplePage = Loadable(lazy(() => import('views/sample-page')));
// import new view and save it in constant. for e.g
const NewMenu = Loadable(lazy(() => import('views/new-menu')));

const MainRoutes = {
    path: '/',
    element: (
        <AuthGuard>
            <MainLayout />
        </AuthGuard>
    ),
    children: [
        {
            path: '/sample-page',
            element: <SamplePage />
        },
        {
            path: '/newmenu',
            element: <NewMenu />
        }
    ]
};

export default MainRoutes;
```

{% endcode %}

{% hint style="warning" %}
Any route added in **`<MainLayout>`** will automatically go through **\<AuthGuard>**
{% endhint %}
{% endtab %}

{% tab title="NEXT (TS)" %}

1. To add one more menu item in  **src/app**

```
├── src
│   ├── app
│   ├── (dashboard)
│   │   ├── newMenu   -> Replace "newMenu" with any desired name for route setup
│   │   │   ├── page.tsx
```

{% endtab %}

{% tab title="NEXT (JS)" %}

```
├── src
│   ├── app
│   ├── (dashboard)
│   │   ├── newMenu   -> Replace "newMenu" with any desired name for route setup
│   │   │   ├── page.jsx
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://codedthemes.gitbook.io/berry/routing/new-menu.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
