Dean Hudson – Product Designer

Dean Hudson

Product Designer

Perfect dotted line in Sketch 2.0

My original post on creating dotted lines in Sketch was quite popular. Unfortunately, with the 3.4 update the method I described stopped working (dash values couldn’t be entered as decimals).

Anyway, the good news is I spent some time this week figuring out how to make it work again. Here’s what you need to do:

Draw a line and change the ends to rounded.

Draw a line

Then, define the style of your dotted line. For example, I want 5pt dots spaced 5pt apart. In my original method that would mean a border style of:

Thickness: 5, Dash: 0.01, Gap: 10

We can’t enter decimals manually anymore but we can force Sketch to enter them automatically. To do this, you need to multiply all of your values by 100:

Thickness: 500, Dash: 1, Gap: 1000

Multiply values by 100

This is going to create a huge circle. Next, you want to select the line and then use the ‘Scale’ tool (Edit → Scale). Change the scale to 1%.

Scale to 1%

Your line will look like it has disappeared but it’s just really, really short. Keep the line selected and change the length to something more appropriate, say 400.

Perfect dotted line

Now you should see a perfect dotted line. If you check the border settings, you’ll see it has a dash value of 0.01.

You can modify the path, resize it, change the colour and it will keep it’s perfect shape. You can also apply the dotted style to other lines and objects (Edit → Copy Style, Edit → Paste Style).