How to use Sketch2React together with InVision Design System Manager


This is another shining example of how community driven we try to be with all things Sketch2React, and how that has been one of our top priorities from the very beginning.

The question was asked by a very active member of our Slack community:

Does Sketch2React work with Craft Manager for Sketch?”.

Since I personally hadn’t been using Craft for years I didn’t have a great answer for that more than the usual ”we’ll look into that, thanks” ? ?

Btw thanks Jason for inspiring me to create this very tutorial.

Where to start?

You need to start somewhere. Of course, being the design nerd that I am I thought to myself ”Hmm InVision DSM seems really really nice, I have been meaning to try it out, now is the perfect time, let’s do this!

Tutorial Requirements

What is DSM?

It stands for Design System Manager and it’s InVision’s answer to the ever growing question: “How the hell do we keep our component library in sync between designers?”

It’s like a design CMS for Sketch ?

Seeing your component library come to life bit by bit is a really nice feeling

What I love about InVision DSM

It works really well with Sketch2React!

Not only that, it works really well with Sketch (duh!) — the whole workflow feels natural. It’s really easy to just jump in, start adding components, text styles, colours, update them, keep on building.

It’s the fastest way to kickstart your S2R projects

Once you have built up your S2R component library you really start to ripe the fruits of your hard labor. You are practically drag+dropping real code components onto Sketch, something you really need to experience.

It’s surreal and even myself, deeply invested in Sketch2React, have a hard time getting used to it. It’s amazeballs!

Write down some useful instructions for your other designers and baam they will get up to speed in no time ??

Building feels natural

We are designers and we love building things. Using DSM really enhances that feeling. You can write down documentation, scribble down small tool tips, divide things into sections, the tool is a delight to use.


What I don’t love

You always need to be online

To access and update your design system library you always need to have an internet connection. Bummer if you’re commuting and feel like updating your DSM on the go. Totally understandable of course, the very nature of DSM is to share everything with others. Would be great with some kind of offline magic though. One can wish ??‍♂️

Work around

Make sure to download all your components to a Sketch doc before jumping on that commuter train. Or just use your companies shared internet connection thingie and you can do that jazz whenever wherever. ?

Pricing models

There is only one pricing model and it’s hidden. Well technically free is also a plan, so two then. Free and Enterprise. For this tutorial I’m just using Free.

Enterprise comes with a mystical hidden price tag. Enterprise lets you share your DSM with other designers which is (of course) amazing. Also you get some kind of code inspect thingie but that is out of scope for this tutorial.

I’m fine with the free version for now since I’m building myself a Sketch2React Component Library, that has exactly one user. Me ??‍♂️❤️?

InVision if you’re reading this, please add some fair plans to us designers that don’t have the need to use DSM on enterprise level. You have a great product that many many designers are missing out on. ??‍♂️ And honestly, the whole ”contact us for prices” scares the hell out of me and I’m not alone.


So let’s begin testing ?

This is what you need to do before jumping into Sketch:

  1. Make sure you have the very latest version of Craft Manager installed on your computer machine thingie
  2. Make sure you have the very latest version of Sketch 55.2
  3. Make sure you have a basic understanding of how S2R works, this will be very confusing if not

Preparation is key!

  1. Look at the introductory video that appears first time you click on the DSM icon inside Craft, it’s really great and totally worth 3–4 minutes of your lifetime
  2. Here’s even more great learning resources for DSM
  3. Make sure you have a couple of real code Sketch2React components for this test, feel free to just copy/paste from any of our free demo documents for this purpose
  4. Make sure you convert all of your code components to Sketch Symbols before adding them as Components inside DSM

Clarification

That last part is crucial. You need to convert anything you want to reuse in other documents (as real S2R code components) into Sketch symbols.

Basically everything that you want to appear in our code app and therefore code is considered a code component by our framework.

You need to convert EVERY code component into a Sketch symbol BEFORE uploading to DSM or it will not work

Example

  1. Style your {text} as funky and stylish as you need it to be
  2. Convert it to a Sketch symbol and call it H1 or H2 or Paragraph depending on what component you’re making
  3. Use the shortcut ⌘L to fire up DSM
  4. Go to the folder that is called Components
  5. Select the freshly squeezed symbol you just created from the Layer List
  6. Create a subfolder inside Components and call it whatever you want, mine is called Text (Sketch2React)
  7. Click the big + icon inside of the DSM interface
  8. Your Sketch2React Symbol will now be added into Components inside of DSM and available to be added to whatever new blank Sketch file you need it to be in — amazeballs !

Lets add a grid to DSM ?

Grids are great and they save you lots and lots of time. For speeding up this part make sure you first have downloaded our 9 Free Grids document.


Converting the grid to a Sketch symbol

  1. Open up 9 Free Grids
  2. Select any of the available grids, I’ll choose the one that is called 4 x 4 Grid
  3. Select {container} (see above GIF)
  4. You could delete Title {row} [m4] if you want since that is only used to describe the grid name in our demo
  5. With {container} selected go to Create Symbol (you can right-click and choose it or just use the icon shortcut like I do) and call it 4 x 4 Grid (or anything else)


Uploading your Sketch2React Grid to DSM

  1. Fire up DSM with the neat shortcut ⌘L
  2. Select the freshly created symbol called 4 x 4 Grid
  3. Go to Components and create a new subfolder, call it Grids (Sketch2React) so you can separate S2R code components from non-code components
  4. With the 4 x 4 Grid symbol selected press the + button in DSM (like below) and the upload will begin ??

Neat and ?

Using your Sketch2React DSM Components in Sketch

For most use cases it’s really just drag and drop onto a new Sketch document and you’re good to go.

Most use cases is just drag and drop and you good to go

Most use cases

  1. Create a new Sketch doc ⌘N
  2. Rename Page 1 and call it Start here
  3. Create a new artboard, just use one of the built-in Sketch web or mobile templates, the important thing is to call it Start
  4. Fire up InVision DSM ⌘L
  5. Drag and drop any of your S2R enhanced real code components from DSM onto your blank artboard
  6. Save your document
  7. Open up our code app and link to this very same Sketch doc
  8. You should see the S2R components that you just drag+dropped from DSM in our code app
  9. Do a happy dance!


Grids & Complex Layouts Use Cases

Say that you use one of our 9 Free Grids or you have designed your own template grids by just using our practical {rectangle} component, divided everything nicely into {rows} {cols} — and then saved them as stated above as Sketch Symbols. When drag + dropping your Grid S2R DSM components onto new documents you will want to do this:

  1. Create a new Sketch doc ⌘N
  2. Rename Page 1 and call it Start here
  3. Create a new artboard, just use one of the built-in Sketch web or mobile templates, the important thing is to call it Start
  4. Fire up InVision DSM ⌘L
  5. Drag and drop any of your uploaded S2R Grids from DSM onto your blank artboard
  6. Save your document
  7. Open up our code app and link to this very same Sketch doc
  8. You should see the S2R Grid components that you just drag+dropped from DSM in our code app
  9. Now select the S2R Grid Component, right-click and select Detach from Symbol

Detach from symbol to populate the grids with real content and you’re good to go ??

Why detach from symbol?

Because, big chances are, you will want to populate each {col} with your real content instead of our colourful {rectangle} component ?✅

Of course, say that you first start with a very simple grid, fill it with content and want to convert this into a complex code component that you can update using the overrides? Nemas problemas, just follow the exact same instructions that you now have learned. ?

That was all folks, hope you’ll enjoy InVision DSM together with Sketch2React as much as I do.


As always, have a great one ?❤️

//Juan Maguid, Team Sketch2React

Read this tutorial offline?

We just updated our awesome free e-book Sketch2React Pocket Guide and included (amongst many new thingies) this lengthy tutorial. Download from below ??????

https://sketch2react.io/resources.php