Pages
Each Superblocks app is composed of Pages. A page is an isolated part of your application with its own scope - meaning it has its own set of components, APIs, frontend variables, timers, custom events, etc.
Every Superblocks application starts with one page named Page1. You can view all Pages in your application and navigate between pages using the Navigation.
Creating pages
To create a new page, open the Navigation in the left panel and click the plus button above the page list.
![Add a new page to your app Add a new page to your app](/assets/images/create-page-35b2e40c7b12bd02be73c711a625506a.png)
You will be prompted with a popover to fill out the details for this new page. Fill out an intuitive name for the page - we recommend using PascalCase for consistent naming.
You will also need to provide the Route for the page - learn more about routes.
![Create page popover Create page popover](/assets/images/create-page-popover-38cdc8904abec7a1f7eacc935a366cf9.png)
To rename your page, simply double-click on the page name in the Navigation, or edit it via the Page properties panel.
![Edit the name of a page Edit page name](/assets/images/edit-page-name-b5cfb801b36ca8f17385e08ad0c7aa9c.png)
Sharing resources and data across pages
Today, all APIs, timers, frontend variables, and other resources belong to a specific page and cannot be accessed by other pages (see scope docs).
We will soon support app scope, which will enable you to share these resoures and data across pages!
Pageload event
Each page has its own pageLoad
event that is triggered when the page is navigated to. You can use the onPageLoad
event handler to trigger automatic behavior for when a given page is loaded.