Skip to main content

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

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

To rename your page, simply double-click on the page name in the Navigation, or edit it via the Page properties panel.

Edit page name

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.