# View

The `View` component houses global components common to all views, such as notifications and dialogs. It handles errors, sets the document title, and renders the specified layout. The view and its props are rendered by the router.

{% hint style="info" %}
Props are passed to this component automatically from the [router](/gravity-web/routing.md).&#x20;
{% endhint %}

### Usage

```javascript
import { View } from 'components/lib';
import { DashboardView } from 'views/dashboard';

function MyApp() {
  return (
    <View
      title="Dashboard"
      layout="app"
      display={ DashboardView }
      data={ dashboardData }
    />
  );
}
```

## Props

| Prop    | Description             | Required | Value                                |
| ------- | ----------------------- | -------- | ------------------------------------ |
| display | view component          | required | component                            |
| layout  | layout component to use | required | string (account/app/auth/onboarding) |
| title   | document title          | required | string                               |

### Notes

* The `View` component relies on `ViewContext` for managing notifications, dialogs, and error handling.
* The component uses `useTranslation` for internationalization and `useToast` for toast notifications.
* Layouts include `AppLayout`, `AuthLayout`, `AccountLayout`, and `OnboardingLayout`.


---

# 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/components/view.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.
