You can add new dashboard pages to your headless project using dashboard page extensions. You can use dashboard pages to help you manage your project.
The Wix CLI for Headless makes it easy to create and develop dashboard page extensions, and to manage dashboard pages in your project's dashboard sidebar.
For general information about this extension type, read About Dashboard Page Extensions
Follow the instructions below to:
Once this task is complete, your project will have a dashboard page extension that adds a new page to your project's dashboard.
Run the following command and follow the prompts to create a dashboard page extension:
Enter a name for your page's folder. The CLI will create this directory with the chosen name containing your page's files.
Enter the route for your page. The route is the path that is appended to your project's dashboard base URL to access the dashboard page.
The extension files will be created in your local project files under src/extensions/<your-dashboard-page-name>/
with the following structure:
For more information about these files, see Dashboard Page Extension Files and Code
Run the following command to open the dev menu
:
Click the link to open your project's dashboard in your browser and navigate to the page you've created. Leave this window open.
Go to your dashboard page's page.tsx
file and change subtitle
in Page.Content
to "Hello world!"
:
If you use a menu plugin to navigate to your dashboard page, you can customize your dashboard page extension to interact with any data that is passed from the dashboard page that hosts the menu plugin.
@wix/dashboard
package is installed in your project.observeState()
function.
Save your file.
Navigate back to the dashboard page in your browser and see your changes.
Now that your project is ready for production, you can build and release your project.
For more information about building and deploying your project, see Build and Deploy a Project with the Wix CLI for Headless.
To delete an existing dashboard page from your project, delete the subfolder under src/extensions
that contains your dashboard page's files.