Skip to content
Gravity Logo / Docs Gravity home
Browse documentation
Documentation/Gravity Web

Views

Gravity has a custom <View> component that serves two purposes:

  1. Houses global components that are common to all views like notification and modal.
  2. Handles errors

The View component is a wrapper around all of your UI views and can show a modal, create a toast notification or handle an error 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 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.