Paging » Wrapping

Wrapping

Just as with a ScrollComponent, you can use wrap() to create a PageComponent plus add a first page in just one line.

# a first page
page1 = new Layer
    width: 375, height: 667
    backgroundColor: cycler()
Utils.labelLayer page1, "First Page"
page1.style =
    fontSize: "40px"
# creating a PageComponent by wrapping ‘page1’
page = PageComponent.wrap page1
# setting the PageComponent’s properties
# (already has width and height)
page.borderColor = "gray"
page.borderWidth = 1
page.scrollVertical = no
Download Framer project

The remaining pages can then be added using addPage().

Wrapping a page in a PageComponent
Wrapped first page, the other seven added with a loop