Go Headless

/

SDK
Articles
Get Started
Work with the SDK
Set up a Client
Use the Wix MCP
What's New

Core Modules
About Core Modules
sdk
sdk-react (deprecated)
essentials
web-methods

Host Modules
About Host Modules
dashboard
Introduction
About Dashboard Page Navigation
Page IDs
observeState()
showToast()
openModal()
closeModal()
navigate()
navigateBack()
getPageUrl()
openMediaManager()
onBeforeUnload()
addSitePlugin()
setPageTitle()
onLayerStateChange()
dashboard-react (deprecated)
editor
site

Backend Modules
About Backend Modules
activity-counters
analytics
async-jobs
ai-site-chat
app-management
auth-management
automations
benefit-programs
billing
blog
bookings
business-tools
cache
calendar
captcha
categories
comments
consent-policy
crm
dashboard-management
data
data-extension-schemas
ecom
email-marketing
email-subscriptions
embeds
events
forms
forum
get-paid
groups
http-functions
identity
inbox
loyalty
marketing
marketing-consent
marketing-tags
media
members
moderation-rules
multilingual
notifications
payments
portfolio
pricing-plans
pro-gallery
redirects
reports
restaurants
reviews
search
secrets
stores
tags
urls
site-plugins
sender-details
sender-emails
realtime

Account Level Modules
About Account Level APIs
b2b-site-management
domains
resellers
user-management
sites

Frontend Modules
About Frontend Modules
bookings
crm
ecom
events
location
members
mobile
navigate-mobile
pay
pricing-plans
seo
site
storage
stores
window
site-realtime
In This Article

  1. Method Declaration
  2. Parameters
  3. Examples

navigate()

Navigates the user to another page in the dashboard.

Navigate to Dashboard Setup Page

To identify a page to navigate to you can:

  • Look up it's page ID.
  • Use a builder method to generate the destination object for a particular page. Several SDK modules include builder methods for the pages relevant to each module. For example, bookings, blog, and ecom all provide builder methods.

If you specify an invalid page ID when you call this function, the Wix user will see "Page Not Found" in their dashboard.

Note: Currently, you can't call navigate() to navigate to pages built when developing sites or building apps with Blocks.

You can specify how to display the page you're navigating to using the displayMode option.

There are two display modes available:

  • Main display mode: The browser replaces the current main page content with the new page.
  • Overlay display mode: The new page is displayed in a modal overlay on top of the main page.

Learn more about dashboard page navigation.

Method Declaration

Copy

Parameters

NameTypeDescription
destinationDestinationDestination page to navigate to.
optionsNavigationOptionsOptional. Options for the navigation.

Destination Object

Copy
NameTypeDescription
pageIdstringID of the page to navigate to. See Page IDs to find the appropriate ID.
relativeUrlstringOptional. URL segment to append to the base URL of the selected page. Can include path segments, a query string, and a fragment identifier.

NavigationOptions Object

Copy
NameTypeDescription
displayMode"main" | "overlay" | "auto"When using main, the browser replaces the current main page content with the new page. When using overlay, the new page is displayed in a modal overlaid on top of the main page."auto" (default) causes the page to be loaded in the current context. This means if navigate() is called from the main page, the main page changes. If it's called from an overlay page, the overlay content changes to the new page.
history"push" | "replace"Optional. Determines whether the URL of the page being navigated to is added to the browser's session history, or replaces the URL in the current entry.

Examples

Note: To call this method in self-hosted apps, you need to create a client. See the setup guide for more details.

Navigate to the dashboard's homepage

Copy

Navigate to your own app's page with some internal state

Copy

Navigate to a relative route of the current page

Copy

Open bookings settings page in an overlay page

Copy

Navigate to the home page as a main page from inside an overlay page

Copy
Did this help?