Creating extension pages
What are Extension Pages?
Think of extension pages as webpages that are hosted by your extension. Hence, these pages are only available once a user has your extension installed.
What are they for?
Extension Pages can be used to create configuration or settings pages, Terms of Service pages, and similar things you'll like to dedicate a page for.
How to create an Extension Page
- Create a
.jsx
or.tsx
file in thepages
directory. - Write a React component
- Export this component as the default export
An example settings page
How to navigate to an Extension Page
After creating an extension page, you should be able to navigate to it from anywhere in the extension. xtensio provides a utility function visitPage
for that.
To visit a page, just call visitPage
with the name of the page without the file extension.
How to visit a page that was created at
/pages/settings.tsx
somewhere-in-your-extension | |
---|---|
That's all you need to navigate to an Extension Page you've created in your extension.