Sketch tip: How to make a round progress bar
by Christian Krammer from sketchtips.info
The Apple Watch has certainly played its part that a certain UI pattern has become extremely popular lately: the round progress bar, also called “the ring”. There are two ways to achieve this effect in Sketch: The first one is to use the Scissors tool, which I’ve already covered in a recent article, and the second one, which makes use of the border options, which I will cover in this article.
After you have created a circle remove the fill, set a border instead and don’t forget to change its “Position“ to ”Center”. Now enter the border options with the little gear icon in the Inspector. The most important parts here are the “Dash” and the “Gap” fields. Now a little bit of math gets involved. Set the “Gap” to the size of the circle and multiply it with the mathematical constant Pi, which is 3.14159265359. You can do this calculation right in the input field.
So for example if your circle has a width and a height of 200, enter “200 × 3.14159265359” into the “Gap”, which results in “628.32”. Now switch over to the “Dash” field with cmd + tab and start to increase it with the arrow up key. Combine it with “shift” to speed it up and and see how the border of the circle starts to grow. For a full circle match the “Dash” and “Gap” fields. To imitate Apple’s ring actually set the “Ends” to “Rounded” and flip the circle vertically.
Thanks to Meng To for the inspiration.