Nested Symbols in Sketch — I 😍 you.

Noam Zomerfeld
8 min readMay 8, 2018

--

In our last few projects at 3D Systems, we’ve been utilizing nested symbols to create scalable, flexible designs, and in a fraction of the time.

I originally wrote this tutorial to share with my coworkers and help with on-boarding, but I think it’s worth sharing with y’all as well.

Why should we create & maintain a symbol library?

  • Modularity — Create one symbol, swap its contents with text overrides. No pixel pushing.
Overrides example from Ayana Campbell Smith
  • Flexibility — when it’s time to update your UI, changing a button’s shape or swapping a color will take minutes — change once and let propagate your designs, vs hours of changing these elements one by one on each artboard.
  • Hierarchy — If you name your symbols appropriately (❤️ u forward slash) — they all organize under a shared structure.
Pardon the terrible naming in this version.

How to use nested symbols

There are a lot of good guides out there, so instead of writing a new one, I’m going to link to a few discussing symbols and design libraries, then show you how I use them in my own workflow.

Here are a the best tutorials I found on symbols:

Javier Cuello’s article is the ultimate guide:

Read it before continuing to the rest (but ignore the part about stretching and resizing, which has since changed in Sketch)

This one from Ayana Campbell Smith shows you how to use overrides, and recommends using emoji in field names (yes please!):

Another good resource from Lloyd Humphreys:

Important principles while working with symbols, from my own workflow:

Create symbols for *small* and *repeatable* components 👏🏻

Buttons are a good example. Other repeatable components are headers, progress bars, line items (job queue for example), repeating cards (checkout?), etc.

If an element is not going to repeated, don’t bother making it into a symbol.

(If you find out later in your work that it ended up being a repeated element, you can always make it into a symbol and use “Replace With”. See ‘Ready to Begin’ below for more details)

Order and name your layers

UI mockups from 3D Systems’ NextDent 5100 3D Printer for the Dental market

As tracking the overrides in a symbols can be a daunting task, you’d want to order the layers in a logical editing order, and give them good names. In the example above I used title1, title2, title3.

You can use plugins such as Rename It and Sort Me to make this into an easy task.

Use the same label for text fields

Use the same name for a field if it’s repeated in multiple symbols. For example, I name all the text fields in my button symbols “text” or “label”. That way, when you change a symbol to another, it remembers your overrides.

Use forward slash (/) in symbol names for good hierarchy

Use descriptive names, and give your symbols hierarchy and structure — btn/box/pressed, btn/box/nopressed will appear as part of the same dropdown menu.

Same principle works for Text Styles:

From Bunin’s awesome article about text styles (read it!)

Try to create *ONE* symbol for an element, and use overrides and nested symbols

For progress bars with different colors I created several symbols (though, I could have nested the color to be its own symbol):

For the group of elements that contains the progress bar (the print status area of a design), I created one symbol with nested symbols in it:

All of the variations below use this same symbol for that element:

Mockups showing different print job states on the NextDent 5100 3D Printer

If I want to change the color and state of the progress bar, all I have to do is select from a dropdown. For text overrides, I just have to type the new value:

Nesting symbols in other symbols

With proper overrides, you can combine symbols into one. Before nested symbols you needed to create a symbol for each state. Now, you can combine them! 📌

From an early version of the design for 3D System’s Figure 4 Production System

For example, this header from the NextDent 5100L’s design is a symbol, and it has 3 smaller symbols nested in it, below each tab:

The white line under STATUS is a symbol called selector/on and inside of it is a white rectangle. Underneath MATERIAL and SETTINGS there are instances of another symbol, called selector/off — a copy of the first symbol, but with the rectangle’s opacity set to zero.

This header is repeated throughout each screen of my design. I can toggle which tab is showing as selected easily, without pushing pixels around.

I use the trick of symbols with transparent “turned off” elements a lot for optional icons in row of buttons, or complicated symbols such as line/list items.

From Jaime Q.’s designs for the Figure 4 Modular System

Those were the basics for Nested Symbols usage! If you wanted more finicky Pro-tips, keep reading below.

Organize your symbols page often

Sketch has the tendency to add new symbols in random locations on the symbols page when you create them. I recommend going to that page after adding new symbols, and dragging it to its group.

I use giant headers for those sections so I can navigate my sketch page easily from a bird’s eye view.

Want to experiment with an element without messing your entire design?

Easy — right click and detach the symbol. It’ll become a regular group of objects.
Modify it at will, and then if/when you’re happy with it, either create a new symbol or overwrite the original one in the Symbols page.

Replacing an image inside a symbol

You could override text in symbols for a while now, but recently Sketch has added the ability to modify an image inside a symbol. If you create your buttons / symbols with images in them — you can use one symbol for all buttons for example, while replacing the image inside:

What that means for my workflows, is that when I’m creating symbols with icons in them, I don’t use the vector for the icon! I instead export it and import it back in as an image (png or pdf), so I can use the same symbol.

Each symbol has one image, scaled to the right size, and one background. Naming is consistent between icons.

Multi-line support for text overrides?

⌨ ️Yes you can. Hit Alt+Enter in the override box to enter a line break, or if it’s easier, copy paste two lines from another text editor.

Too many moving parts in the overrides panel?

If there are elements you don’t want to be editable / overridable — lock their layers in the symbol “artboard” on the Symbols page.

Margins, padding and touch targets

Symbols are a great place to insert concepts like margins or touch targets to your design. For example, the icon-buttons above are visually 32px but the symbol artboards they exist in is 44px. The entire 44x44 area is the touch target for these buttons, and using the symbol in my designs reminds me and the developers to account for that.

Ready to replace a regular group with a symbol?

Lets say you created a bunch of buttons in your designs that aren’t symbols. But you’re ready to use symbols instead. Easy!
Create the symbols you need, and then right click the item to be replaced, and choose Replace With. It will show you the symbol hierarchy to select the symbol that will replace this element.

Note: you’d have to adjust the new symbol to the right size, as it will automatically compress your symbol to fit in the space of the replaced item.

From Javier Cuello’s article on Smashing magazine

That’s the easiest way to start using symbols on an established sketch file!

Summary

I hope this helps you tackle the huge work load in maintaining designs for large systems. It certainly helped me to put this all in writing.

Let me know if there are any questions, suggestions, corrections or improvements. Sketch is constantly growing and you lot are smarter than I.

Happy nesting!

--

--

Noam Zomerfeld

Interaction Designer, Tinkerer and Human Wizard. Currently working on the next generation of 3D Printers with 3D Systems. 👋🏼