# Views

Gravity has a custom [`<View>`](/gravity-web/components/view.md) component that serves two purposes:

1. Houses global components that are common to all views like [notification](/gravity-web/components/notification.md) and [modal](/gravity-web/components/modal.md).
2. [Handles errors](/gravity-web/handling-errors.md)

The `View` component is a wrapper around all of your UI views and can show a [modal](/gravity-web/components/modal.md), create a [banner notification](/gravity-native/components/notification.md) or [handle an error](/gravity-web/handling-errors.md) from anywhere in your application.

### Creating New Views

To add a new view to your application, you add a new view file in the `/client/src/views` directory and [add a new route](/gravity-web/routing.md#defining-a-new-route) in Node.js.

In Next.js you create a new page.jsx file inside the /src/app folder.

You can also generate new views quickly using the [toolbelt.](/gravity-server/cli-toolbelt.md)


---

# 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.usegravity.app/gravity-web/views.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.
