1

I want to include multiple pages in grapesjs framework.

1 Answers1

1

Grapesjs now supports pages using PageManager. you can have a look at the API documentation here https://grapesjs.com/docs/api/pages.html

The way to do it is

const editor = grapesjs.init({
 ....
 pageManager: {
   pages: [
     {
       id: 'page-id',
       styles: `.my-class { color: red }`, // or a JSON of styles
       component: '<div class="my-class">My element</div>', // or a JSON of components
     }
  ]
 },
})

You can add,remove , select the pages by using the methods from grapesjs.Page.

Ashwin Valento
  • 878
  • 1
  • 7
  • 14