Alexander Katin
Jun 6, 2016 · 2 min read
Image for post
Image for post
Nice pic by Dmitri Popov


Sometimes while working with Sketch we face situations where we need to maintain simple proportions of layers and artboards.

By simple proportions I mean 1:2, 2:3 and the like. Sometimes it could be more technical, say, widescreen ratio of 16:9, etc. So it could be handy to have a tool to apply this ratios.

A couple of weeks ago I’ve developed Formr plugin for Sketch that does just that: applies simple ratios to working elements. It took me two or three days to write code and another day to make videos, screenshots and finally create a simplistic landing page with Readymag.

It was truly an MVP product: it could do only one thing and had a very limited list of available ratios.

I’ve recently added new functionality and shipped second version of Formr. New, updated Formr can extract proportions from layer names, which, I hope, will save you couple of mouse clicks.

How to use

Image for post
Image for post
Installation via Sketch Toolbox

Install plugin either via Sketch Toolbox (neat!) or manually by downloading zip and double-clicking .sketchplugin file inside.

You can also use custom proportions by adding ::RATIO to the layer/artboard name where “RATIO” can be any simple fraction and than pressing ctrl+alt+shift+e. For example, adding ::1/2 to a 100×100 layer name and calling the plugin gets you 50×100 layer dimensions.

A screencast showing some features in action

Formr supports layers, artboards, and multiple selection. It also works with latest versions of Sketch (3.8+ at the time of writing).

Helpful links and tools

  1. for debugging. It’s mind-boggling at first, but after some time it comes quite naturally. Here’s a great article by Ale Muñoz. Functionality of built-in plugin sandbox might be sufficient until your plugin structure grows and you won’t be able to debug it.
  2. Developer section on Sketch official website gives you a quick start. Some parts are badly structured and can be confusing in my opinion. While working on a plugin I had a constant feeling that Sketch plugins API is poorly documented, but, again, I may be wrong.
  3. Tutorial on building plugins by Yari D’areglia.
  4. I strongly recommend taking a look at the source code of some well-established plugins. Measure or Magic Mirror for instance.
  5. Check out this series by Magic Mirror’s author, James Tang.
Image for post
Image for post
Based on a photo by Sandra Starke

Design + Sketch

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store