A question that regularly pops up in the Framer community is how to use Framer if you’re using a PC. Currently, Framer Studio is only available on a Mac but the Framer.js framework, that powers Framer Studio, is free and open source. That means if you’re using Windows, Linux or on a Mac but still on the fence about purchasing Framer Studio, you can still create Framer prototypes.
For most of us, we want to do as little configuration as possible — that’s where Atom comes in.Atom is a free, text editor from GitHub that’s modern and customizable to do almost anything without ever touching a config file.
With a few simple steps, Atom takes care of that for us so we’ll be able to create Framer prototypes using CoffeeScript and preview them on our PC, Linux, or Mac machine. Let’s get started:
1. Download and install Atom
Go to the Atom website and look for the button to download. The button should be specific for your platform.
- If you’re on a Mac, you’ll download a zip file. Simply unzip it, move it to your Applications folder and run Atom
- If you’re on a PC, run the installer and then open Atom
- If you’re on Linux, download and install the Debian package or RPM package
2. Install Packages
When you launch Atom for the first time, you should see a welcome guide.
Click on the “Install a Package” button on the right pane and then Open Installer.
The Install Packages screen should appear. If the future, you can also access this Settings screen through Preferences and then the install tab.
Search for the “atom-html-preview” package and install it. This allows you to get a live preview when you make changes to the code.
If you click the Packages tab, you should now see your 2 new installed packages under the Community Packages section.
3. Update Package Settings
4. Download the Framer.js Starter Template
Once downloaded, unzip the file and open up the Framer folder.
Framer Generator is an application for Mac that comes bundled with Framer.js. It allows you to import layers directly out of Photoshop and Sketch files into your Framer projects . This feature is built into Framer Studio.
Let’s look at the files in the project folder in more detail:
- /framer/framer.js.map — This is a SourceMap file. It maps the code within a compressed file back to it’s original position in a source file to allow you to debug code for compressed file. You don’t need to worry about it and like the framer.js file, you don’t want to touch this file either.
- /images/background.png & /images/icon.png — The icon image is used in the default prototype and the background image is just a black background that is specified in the CSS.
- index.html — Open this file in a WebKit browser — such as Google Chrome or Safari to view your prototype. If you look at it, it includes the framer.js and app.js file that we looked at earlier.
5. Open up the Project folder in Atom
Go to File – Add Project Folder and open up the Framer Project folder template.
6. Rename app.js to app.coffee
Right-click on the app.js file and then select rename.
7. Write your CoffeeScript code
# Prototyping with Framer
# Create a background
new BackgroundLayer backgroundColor: “#151517”
# Create a layer with the Framer logo
logo = new Layer
# Create additional states (the original state is ‘default’)
# Create a spring animation
# Animate to the next state on click
logo.on Events.Click, ->
Save your file when you’re done writing your code and you should see an app.js file appear in your project folder.
8. Preview your Prototype
Click the index.html file in the sidebar and then go to Packages – Preview HTML – Enable Preview
You should now see your Framer prototype that you can interact with on your Windows machine.
Note that although there is a live preview, updating the app.coffee file doesn’t trigger a refresh. You’ll need to make your updates to app.coffee, save it to generate a new app.js, and then in your index.html file, make a change – such as adding a return to one line or deleting a blank line. The prototype will then refresh with your newest code.
Now that you’re able to use Framer on Windows, I can’t wait to see what prototypes you come up with. If Atom isn’t your style, you can also check out a Framer video I did as part of my Rapid Prototyping with Framer course for O’Reilly where I also show you how you can use Framer with another text editor, Brackets, as well as with online code editors like CodePen.
In my personal opinion, if you’re on a Mac and plan on using Framer past the trial period,Framer Studio is well worth the price for the amount of time you’ll save with features like easily creating new projects, instant visual feedback, inline error checking, code completion and much more.
Do you have any tips or additional questions for using Framer on Windows? Let me know with a comment below or share your thoughts with me on Twitter (@kennycheny).