3

I'm trying to create modifiable progress bar symbols in Sketch. Those are rectangular and circle one on the picture below:

progress bars

To modify that rectangle so it would suit different percentages I created separate progress bar symbols to nest in the main one like so:

symbol properties

I don't think this is the only way of modifying progress bar. A while ago I saw a tutorial how one guy regulated progress length bar using text override. He somehow linked mask to the text field. Thus, he could regulate the length of the progress bar with the amount of text symbols typed in the override. I can't find the example and forgot how he did that.

How can I create one progress bar symbol and modify progress bar without creating additional symbols for each percentage?

1

I don't think there is a really good option to do that right now.

The best solution I found :

  1. Create progress and progress_backround symbols

progress and progress_backround symbols

  1. Bring them in an artboard, make them 100px large and group them. This will be your progress bar base.

grouped layers

  1. Double click on the progress comp, this will bring your to the progress layer and set the size, let's say 76px (for 76%)

set size

  1. Now you can resize your progress bar resize progress bar

Hope it helps

  • It doesn't really help because this way all instances will be edited. At least with Overrides OP can have bars that have different progress levels. What happens if all your progress bars have the same lenght like in the question (and that is the most common case)? – Luciano Aug 3 '18 at 15:33
  • 1
    All the instances are not being edited. The progress_comp is only a group that you can duplicate. It's 100px large so it's easy to set a percentage. 1. duplicate the group that contains the two symbols 2. on the duplicated one, set the percentage on the progress symbol (F.E. 65px for 65%) 3. resize the duplicated group The original progress_comp group is only here to be duplicated – Guillaume Gautier Nov 11 '18 at 11:11
0

As seen on this post, you need the Auto Layout plugin.

Rectangular Progress bar

Make a symbol with this structure:

layer structure

Slider: A horizontal stack with 0px margin that contains a text layer at 0% opacity set to Auto width, and your progress bar fill. This stack is pinned on the left edge.

Bar Mask: that will mask the bar to show the correct amount of progress.

Container: that is the shape of your progress bar.

The slider stack layer should be moved off to the left of the symbol artboard. When you override the text layer (you can write anything) that will push the bar to the right and display an amount of progress: straight progress bar

Circular progress indicator

I made a symbol with a masked text on a circular path. In this case I used the text itself as the progress bar using an ASCII character █. Then the override is the bar itself. (in hindsight, you can probably do the same if your rectangular progress bar has straight edges).

circular progress bar

You can probably make something more fancy and have a second override for the text inside the circle, this was a quick proof of concept.

-2

This is the tutorial you are referring to. https://medium.com/ux-power-tools/how-to-make-a-progress-bar-symbol-in-sketch-that-actually-lets-you-resize-the-progress-bar-c155b04eda1e

We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.

  • 4
    While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. – Wrzlprmft Feb 12 '18 at 8:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.