2.4 Sketch Layers and Groups
When creating an element on the canvas or in an artboard in Sketch, a layer is automatically created for that element in the layers panel. This is actually very helpful because that layer gives us a direct reference to a specific element on the page. And because it’s also possible to rename layers and group them, we can do a great job organizing our page.
Let’s learn more about Sketch layers and groups.
1.Introduction1 lesson, 02:11
2.The Sketch Fundamentals8 lessons, 1:16:06
3.Reusing Elements and Styles4 lessons, 30:30
4.Prototyping2 lessons, 12:51
5.Collaboration2 lessons, 13:26
6.Plugins2 lessons, 11:06
2.4 Sketch Layers and Groups
When creating an element on the canvas or inside an art board, a layer is automatically created for us in the layers panel, and that layer is basically a direct reference, to a specific element on the canvas. And because we can rename layers and we can group them and we can move them up and down, it's really easy to organize our content this way. So, let's learn more about this. As I was saying, if we're gonna grab the rectangle tool and create a rectangular canvas, we can see that a layer is automatically created for us in the layers panel. If I click this, it will select the element on the canvas that it corresponds to. Now, with layers we can rename them by double clicking, or by right clicking on it and selecting rename. I can also select multiple layers. So if I have, let's say, two more here, notice the two shapes that are automatically created. I can select these, from the layers panel, or I can click on these individually on the canvas. And the thing with layers, is that when you select two or more, you have alignment and distribution options, right here in the top of the inspector. So first of all, these first ones are the distribution options. So you can distribute layers horizontally, or you can distribute them vertically. And actually to understand these better, let's position them like this. So select them again, and let's distribute these horizontally. This will basically create the same distance between each layer and very useful for when you have repeating elements like in a menu, right? You need to have the same distance between each menu item. Well, this is one of the ways you can do that very easily. The vertical distribution is the same thing, when you have your layers sitting like this, You can select them and you can distribute them vertically And when that happens, either horizontally or vertically, actually sketch gives you a nice control here that you can use to increase or decrease the distance evenly across all elements. So it works, in the other orientation as well. Just make sure you distribute them, and you'll also have access to the same controls, very, very handy. This way, you can change the distance between all the elements you selected, all at once you don't have to modify each element separately, this is actually a huge time saver. Now the recommended technique is to place those layers inside our pores, so let's create a nod board here, and let's create a couple of layers just some random shapes here, we're also gonna use the strangle shape since I have it. And now I wanna talk about a very useful feature in sketch that's called smart guides. Now, smart guides will actually show these red and blue guides telling you when you're aligning certain things, for example, these two items are now aligned. Now, these two items, the rectangle and the circle have their center axis there, horizontal axis aligned. And it can also see the distance in pixels between these elements. Very handy for when you want to make quick adjustments. So if I'm gonna notch this up, I can press option on my keyboard, hover, with my mouse cursor on a specific element and then I will get measurements from the edges of my element to the element I'm hovering on, and this is actually super, helpful. Let's try that within one this triangle. A very, handy tool for when you want to make these fine adjustments like, you can leave your cursor on that shape and I can use the arrow keys to move this element to the desired position. How cool is that? Now with layers, you can use groups. Which means you can group the layers basically, you can create a group out of a single layer by simply selecting get in hitting group, or command G or right clicking and select group selection. So that created a group, notice the icon here has changed, and now we can now expand and collapse the contents of that group and we can also bring in more elements to that group. And we can do that by going to the layers panel clicking on the layer and dragging it into that group. And then I can reorganize, elements inside that group by simply dragging them. Or I can do this right from the beginning by selecting two or more elements. Right click, Group selection. So now that created a group, with the two elements that I selected, and groups, just like layers can be renamed. They can be hidden or shown and you can basically move them around, do all the things that you would normally do to layer. And groups are very useful for, well, grouping elements. If, for example, you have a collection of elements that all belong to, let's say a page header, then you would group all of of those elements and call that group page header. Then, when you want to find that group in the layers list, you can very easily do that by its name, or, you can actually filter by name, and you will find that immediately, or you can click on that group and all or the entire group will be selected. So you don't have to select all of the elements individually, very helpful. So that's how you can use layers and group to organize the content in your, canvas or pages or art boards. Now, since we're speaking of elements, let's go ahead and create one and learn how to work with the various types of elements. We'll start with the next lesson with shapes and vectors, see you there.