Code
Code Component
Framer X

Get canvas width/height of a code component

Framer passes width/height props to all component instances on the canvas. You can use them to make your own components resizable.

class CodeComp extends React.Component {
  render() {
    const { width, height } = this.props;
    return (
      <Frame width={width} height={height}>
        ...
      </Frame>
    )
  }
}

PS: If you find this tip difficult to understand, check out this course I prepared for you, where concepts are explained in a more digestible way. No programming experience required!

PPS: See other pro tips, or share / request a new tip.


© 2018 jimu Labs, Inc.