This is a brand new version of an old article that I wrote back in June 2018. Has been updated to how things work today.
A very brief overview on how our framework, code app and plugin work. Just to get you started.
? Step 1 — Do your design magic
First design your stuff. Then it’s time to analyze your design and mentally (or on paper) divide them into Containers, Rows and Columns. We use Bootstrap so a basic understanding of how the grid works is very very recommended.
Then you can go two ways: either you do it all by hand (recommended for advanced users) or you use our plugin to create folders containing things like rows, columns, paddings and margins. Our plugin is NOT REQUIRED for this to work, but it will help you in the very beginning speeding up your understanding of how things need to be setup inside of Sketch.
?Important! The page (in Sketch) needs to be named Start here and the first artboard needs to be named Start or our code app will not read your .sketchfile correctly.
? Step 2 — Moving and naming stuff
This step is the most important one. It’s now that you begin giving your Sketch design file the super power of Bootstrap 4 and React without even leaving the document. You are enhancing your design with real code components and the amazing responsive Bootstrap 4 grid.
You add our components in Sketch by using very familiar built in Sketch tools like the Text Node (T), Grouping (⌘+G) and the shapes we support.
Number one rule: You need to name each layer and group with our component names or it will not work at all in code!
Example on how you create a {container} in Sketch
- Create a text node (T)
- Group that text node (⌘+G)
- Rename group {container}
- Delete text node or name it {text}. If you named it {text} this very text node will show up in code. Yes!
Check our Components or Cheat Sheet. And please study our demo files. General rule to remember is: you use nothing more than very familiar Sketch tools for all of our components. No plugin required.
?Step 3 — Link to our Desktop Code App
???Now comes the really fun part, seeing your static Sketch design file starting to come alive!
You use our desktop Code App for this. You get access to our app by signing up to our beta program.
If you have done your homework of Step 2, you will see your design file beautifully rendered and fully responsive based on what you have set up.
How to use install & use our Code App
First you need to signup to our beta program. Once you have downloaded the app you install it like any other Mac app on your computer. After that follow these simple steps to get up and running:
- Open up our Sketch2React Code App
- Go to File — ->Open (⌘O)
- Open up the .sketchfile you are working on
- That same file is now linked with our Code App
- Happy makings!
Why can’t I install your code app?
All Mac apps that are not certified by Apple that you download from the web or distribute privately (via your own channels) give you a warning the very first time you open them.
Just chill and do like below and happiness will (maybe) come to you.
- Go to System Preferences
- Click on Security & Privacy
- It will contain a message that says “Sketch2React Code App was blocked from opening because it is not from an identified developer”
- Click on Open Anyway
You been good, now go celebrate this with a great cup of the very best company coffee you can find ☕
Sketch2React Code App features
- Hot Reload — Every time you save in Sketch it automatically reloads that file in our code app
- Offline Mode — Everything that does not require an internet connection in your design file will work offline
- Mobile View = Opens up another responsive window of your design with the start width of 576px
- It’s super fast
- Use CSS plugins ????
- Handy shortcuts to our documentation & tutorials (requires internet connection to work)
How to download HTML from our Code App
- Go to the sidebar in our app and click Download
- Choose where to save
- Do this for each artboard you want exported to HTML5
Handy shortcuts in our Code App
⌘O = Link to your .sketchfile
⌥⌘M = Mobile View, opens up a new responsive window with start width 576px
⌘D = Documentation
⌘T = Tutorials
⌘F = Demo files
⌘P = Publications on our blog