Layers are the building blocks for creating a design in Sketch. In other graphics programs, sometimes the difference between layer and object is insignificant; In contrast, each object in Sketch is always on its own layer. We will use the term "object" and layer "alternately in this article for the reasons mentioned above.
Group and Artboard are also used in Sketch to organize content, they are also considered layers with their own roles. To add a new layer to your project, just click on the Insert menu in the toolbar or menu and select the type of layer you want.
Add layer
The easiest way to add a layer is to choose a standard shape from the toolbar. Choose Insert > Shape and then Rectangle (or press R ). You will see the cursor changes to the Draw Rectangle tool icon .
Click on the canvas and drag to insert shapes. When you release the cursor, the shape will be inserted to prepare for the next refining steps.
Without selecting any layer, you also have the right to insert a new layer into the Canvas via the Touch Bar of MacBook Pro. Here, we will choose to insert the layer right from the keyboard, including Artboard, Rectangle, Oval, Vector, Text and Image. Sketch also provides shortcuts to insert shapes quickly.
Select the layer
Selecting a layer in Sketch is extremely simple: just click on the layer on the canvas to finish. Once selected, you will see 8 small handles spread evenly across the corners and edges.
Another way to select a layer is to use Layer List: click the layer name in the list to select the corresponding layer on the canvas.
Sketch allows selecting multiple layers by holding down the Shift key on the keyboard and clicking on the new layer. To select a layer that is hidden under another layer, just press Ctrl + click and select Pick Layer from the shortcut menu. Here you will see a list of all layers below the cursor.
Move layer
The user can move the selected layer by selecting and then moving with the cursor. When you move or change the size of a layer, Sketch will automatically line up the layers to adjacent layers.
If we hold down the Option key while dragging, we will duplicate the new layer and return the original layer to its position. In case of pressing Command-D immediately , Sketch will insert a duplicate layer in place of the original layer. Drag and drop layers into the Pages panel to quickly move objects between pages.
With the feature of moving layers, the Sketch software also supports moving hidden layers, arranging, distributing and arranging multiple layers to neatly, moving multiple smart layers, swapping positions ... depending according to the operation needs of each user.
Resize the layer
The 8 handle not only shows the selected layer, you can use it to resize the layer. Click on any handle and drag to resize the layer as you like. If you hold down the Shift key while manipulating, the program will resize in proportion: width and height and scale.
To individually resize the width or height of the layer, keep the handle on the side to be changed. If you want to resize all directions, use the handle at the corner. If you hold down the Options key , the layer will resize from the middle instead of from the opposite corner.
Besides this manual resize, Sketch also supports resizing the layer with the Inspector tool , with the keyboard, according to the scale ...
Resize according to binding rate
Applying the constraint allows you to define the shape of the object after resizing the icon, Artboard or layer group in it.
For example, you want the layer to always be centered in the Artboard or the specific group is always in the upper left corner of the icon, regardless of the height or width of the object. All of these requirements are handled by the binding ratios you apply to the layer.
Constraints apply to all layers within an Artboard or a group. When selecting a layer, users will see the binding rate appears in the Properties section of the Inspector bar . This is also where you can change the rate and shape of the object after resizing.
Edit the layer
To edit a layer, double-click it on the canvas or click Edit on the toolbar. Depending on the type of layer to be edited such as shape, vector, image or symbol, the way to edit will be different.