Building Responsive Sketch Symbol Components
Previously, I wrote about Dynamic Icons in Sketch, and today we’ll finally expand upon that. Apologies to the masses and my huge list of 471 followers (right?) for how long this highly anticipated article has lingered unfinished. I know you’ve been eagerly waiting.
I should note I’m doing all this great work for CircleCI and their continuous integration, continuous development solution.
Symbols are imperative for consistency and quality control when we work in teams. Without them, our teams enter a world of chaos where The Inmates Are Running the Asylum (highly recommended reading).
Symbols can also be a drag. They’re restrictive, scale awkwardly, and are rarely adaptable. As a result of trial and experimentation, I’ve setup what I consider to be the best practice for making component symbols function. Instead of looking at something and exasperatedly thinking, “Ugh, in order to make this work, I need to detach from symbol,” we want to think, “Let me override this, override that, scale this, and voila! This works.”
Let’s use Breadcrumbs as an example.
How do you make Breadcrumb Symbols better?
The beginning of a breadcrumb is easy. It is composed of a background, some text, and maybe a button. When we begin to address the second, third, fourth tiers and their associated actions, things get fuzzy.
For example, should we make a separate symbol for each use case? Possibly.
At the other end of the spectrum of complexity, “How many overrides are too many overrides where this symbol loses it’s effectiveness?” The markers of depreciating return are subjective, but I’ll recommend a path.
Setting up your Symbol(s)
You can go a number of different directions here. I’ll lay out the simplest and hardest approach.
- Your Title element should pin to left.
- Button 3 (farthest right aligned) should pin to right. Click fixed heightand fixed width. (Each additional button will have the same setting and spaced as you dictate. Selecting fixed height and width will make sure it doesn’t change size as you scale the breadcrumb in any direction.)
- (Optional) Lastly, if you followed my procedure for Dynamic Icons, make sure you’re pulling your button from your saved Symbol Library (denoted by the linked ovals). This will bring in the appropriate Icon, Color, State, and Background Color Overrides.
- As a result, the breadcrumb can shift dimensions in any direction. It will be responsive and maintain center alignment and spacing. (See Below)
Pro Tip: How did you get the background to scale with that stroke? Create the background shape, add an Inner Shadow > Select Color > x 0, y -1, Blur 0, Spread 0.
All of the above rules apply when you’re trying to create something a little more involved. The only additional note is to make sure every element you add is pinned to left.
The elements of the symbol are arranged vertically in my layer list as they appear left to right in the actual symbol. This helps make the overrides section easier to scan and navigate. You can name your carets “ignore” or however you see fit. I just ignore them.
Turning Multi-Level into 1 Level, 2 Level, 3 Levels, 4!
At this point, we have a simple breadcrumb and one that goes many layers deep. The number of overrides may appear daunting. However, if you name your layers well, you’ll find you can make quick changes to fit your needs and reduce symbol one-offs. You can remove a level of the breadcrumb by selecting none for a caret or typing a space in a title to make it disappear. A bit hacky? Maybe. But, it keeps you contained in a symbol that you can trust is accurate and up to date. Instead of 6 symbols for 6 layers of a breadcrumb, you can make one symbol to rule them all.
- You can change button and icon colors.
- You can add a label, remove a label.
- You can resize the breadcrumb in any dimension.
- You can change any text and the layout will maintain its integrity.
That said… Since every designer is different, I’ve broken out all the layers to let people be flexible with these symbols. This flexibility puts some extra rigor on maintaining the style guide and Symbol Library, but it ensures designers will find what we need quickly and easily.
Download File: https://cl.ly/1q1a3J213E3n
For this sample file, I chose a select set of icons and colors and made them regular symbols in the document as opposed to a set of Symbol Library docs. Refer to my other posts about Sketch Library Best Practices.