In this tutorial, we are going to create a slider control (a very well-known input control pattern) used in mobile or desktop UI. This type of control allows the user to select a value between a minimum and a maximum. If you want to learn more about this control type, you can take a look at the Apple HIG here.
To make everything work (on the interaction part), we will use a bit of logic to respond to the drag event in order to change the slider value (but we will not be going to use global variables for this).
The reason for not using a global variable to handle the toggle state is because we want this component to be self-contained (without dependencies) to be easily reused across projects.
To follow along, you need to have Axure RP installed. You can download the appropriate version (Windows or Mac) from Axure Website.
Axure RP is a well-known prototyping tool with a lot of history, that has been around for years (about 18). You can create almost any kind of prototypes, from simple ones to more complex ones with variables and logic without writing a single line of code (well, when dealing with the complexity you will need to write some expressions).
If you are a bit familiar with Axure RP and know about widgets and interactions, then you are on the right track. If not, you should still be able to follow the steps in this tutorial.
This tutorial's difficulty is simple to medium. To create the slider, I’ve broken things down into 2 simple steps.
In this step, we are going to create all the necessary shapes for our slider. To see an overview of the shapes and structure, take a look at the image below.
Basically, we have only one group called “Slider” and inside we have:
2 icons (that are optional, and they represent the minimum and maximum)
the "+Knob" which is a dynamic widget (the reason for having this dynamic widget is that we need to respond to the drag event that is available only on dynamic widgets); It has one single state (default in our case) and inside this one we have one ellipse “Knob”
"Fill progress" — this represents the current value visually (with a blue fill)
"Track line" — is the entire track line
"Background" — out background for the component (can be optional)
If you don’t have too much experience with Axure shape widgets then you can read more about them here.
See all the shape properties below.
+Knob (dynamic widget):
The only interaction that we are going to add is on the +Knob dynamic widget on the dragged event. Basically, what we want is to allow the user to drag the knob on the horizontal axis in order to change the slider value.
To achieve this we will use some expressions inside 2 actions with the following settings:
a) Action Move:
b) Action Set Size:
If you are not really familiar with events, actions, cases you can read more about them on the Axure website.
Creating a slider UI component is relatively easy in Axure RP. Now, we can use our new slider component in future projects.