This is a read-only archive of the Framer Community on Facebook.

What is Framer? Join the Community
Return to index
Arvi Raquel-Santos
Posted Jul 28 - Read on Facebook

How do I set the width and height of a pageComponent that references a sketch file? In the example, the circles should scroll horizontaly from the edge of the screen? I tried "circle.width = Screen.width" but that didn't seem to work. I also tried adding a mask in sketch but it wasn't importing the layers properly...

http://share.framerjs.com/f876tp4io5s4/

4 Comments

Văn Công Bằng

try page.width = Screen.width if you name your pageComponent "page". There's a problem on server, i can't view your example

Văn Công Bằng

you should add this code:
for layerGroupName of sketch
window[layerGroupName] = sketch[layerGroupName]
so you don't need to type sketch.layerA.width, only use layerA.width

Arvi Raquel-Santos

my file structure in Sketch which I'm thinking is where the problem lies based on what I've been reading regarding the scrollable template.

Benjamin Den Boer

Hey Arvi Raquel-Santos, in this case, you can target the sketch.horizontal layer directly and adjust its properties before it gets wrapped within a PageComponent. Like this:

sketch.horizontal.width = Screen.width
sketch.horizontal.x = 0

Read the entire post on Facebook