# Routing & Pages

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

{% stepper %}
{% step %}
Create the View

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

{% code title="REACT" overflow="wrap" lineNumbers="true" %}

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

{% endcode %}
{% endstep %}

{% step %}
Import the View

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

{% code title="REACT" overflow="wrap" lineNumbers="true" %}

```typescript
import MyPage from "@/views/MyPage";
```

{% endcode %}
{% endstep %}

{% step %}
Register the Route

Add your route to the `AppRoutes` array.

{% code title="REACT" overflow="wrap" lineNumbers="true" %}

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

{% endcode %}
{% endstep %}
{% endstepper %}


---

# 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://docs.17movement.net/phone/building-custom-apps/routing-and-pages.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.
