# Views

Views are the main screens in your application and are comprised of various components.

Gravity comes with pre-built views for you to use in your app, including:

* Auth views (sign up, sign in, reset password)
* Account views (profile, password, users)
* x2 dashboard templates

{% hint style="info" %}
Views are located in the `/views` directory
{% endhint %}

## Creating a New View

There is a `template.js` file inside the views directory that you can use to speed up the process of creating new views.

Your components within a view should always be wrapped inside a [**\<ViewContainer>**](/gravity-native/views.md) which will provide common components such as header, navigation and banner notifications.&#x20;

## Routing the View

Once you've built your view, you need to import it into `/router.js` and add it to a [navigation stack](/gravity-native/navigation.md).

## Private Views

You can restrict access to a view to a specific user permission level. For example: only account admins can access the edit users view.

Inside the router – each view has an `initialParams` object where you can add the user permission level, for example, in the `<AccountTabs/>` stack:

```javascript
<BottomTab.Screen name='users' component={ Users }
initialParams={{ private: true, permission: 'admin' }}/>
```

{% hint style="info" %}
You should also consider conditionally rendering stack objects to only show links to views the user has permission for.&#x20;
{% endhint %}


---

# 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-native/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.
