Pages Properties

currentPage

Type: Page (read-only)

Page that's currently displayed.

Don't change its fields. Every component on the page reads the same object, so a change shows in all of them, and the site doesn't save it.

Example

Copy

mainPage

Type: Page (read-only)

Main page, the page a site visitor reaches at the site root URL.

A Wix user chooses which page this is. To check whether the page that's currently displayed is the main page, compare currentPage.slug with mainPage.slug.

Don't change its fields. Every component on the page reads the same object, so a change shows in all of them, and the site doesn't save it.

Example

Copy

pages

Type: { [pageId: string]: PageConfig } (read-only)

Every page on the site, keyed by page ID.

The values don't include an id. Use the key as the page's ID. To find a page by its slug, search the values: Object.values(pages).find((page) => page.slug === slug).

Don't change the map or its pages. Every component on the page reads the same map, so a change shows in all of them, and the site doesn't save it.

Example

Copy

Last updated: 25 October 2026

Did this help?