First, let’s clarify what exactly is a dropdown menu, and what is a combo box, aren’t they the same? Well … no, not really, let me explain.
Technically speaking, a dropdown menu is different from a combo box. A combo box is a combination of a dropdown menu and text input (confined to a set list of values).
In other words, a combo box is more difficult to prototype because of the dual nature of the control and in this article, we will see how we can tackle this problem by starting with a simple dropdown menu.
So, this article has 2 parts, on the first part you will learn how to prototype a simple dropdown menu and in the second part, we will expand this control into a combo box.
To follow along, you’ll need to be a little familiar with Axure and have some understanding of widgets, interactions, local variables and expressions.
Also, if you haven’t done it yet, you can download Axure the latest version from Axure Website.
Dropdown menus are easy to prototype in Axure, using simple Shape widgets and a Repeater widget for the list of options. To make this control self-contained (without dependencies) we will not use global variables, this will help us to easily reuse the dropdown menu in other projects.
In this part, we will create a simple dropdown menu (a well-known input control pattern) used in mobile or desktop UI. There are multiple variations of this type of control (like pull-down buttons, pop-up menus, droplist and so on), but the principles shown here can be applied to any variation. This type of control allows the user to select an option from a predefined list of options. Usually, the selected option is then displayed inside the dropdown. If you want to learn more about this control type, you can take a look at the Apple HIG pull-down button (a.k.a. pop-up menu) here.
The level of difficulty is easy to medium. Everything was broken into 2 steps, so you could follow along more easily.
In this step, we are going to create all the necessary shapes for our dropdown menu control. To see an overview of the shapes and structure, take a look at the image below.
Basically, we have only one group called “dropdown” and inside we have 2 main groups:
If you don’t have too much experience with Axure shape widgets then you can read more about them here.
Here are more details about each group's shapes and properties (these properties can be changed to fit your needs).
The "dropdown_selection" group contains:
selected_value:
dropdown_label:
dropdown_bg:
The "dropdown_selection" group contains:
dropdown_values_list | option_value:
dropdown_list_bg:
An important thing to mention here is how the dropdown_values_list Repeater is set up, on the data section we have only one column Value and the values are: 1,2,3
You can learn more about String functions from here.
The dropdown menu has 2 interactions added to different groups/elements to make everything work. Here are the details:
The first interaction is added to the dropdown_selection group on the Click or Tap event to Show/Hide the list of values but also to Rotate the dropdown arrow accordingly.
Another interaction is added to the dropdown_values_list Repeater on the Item Loaded event to set up the way the option is rendered
The last interaction is on the option_value item from the Repeater on the Click or Tap event to respond to the changing of the selection(option)
If you are not really familiar with events, actions, and cases, you can read more about them on the Axure website.
This is it! We now have a simple and functional dropdown menu, so let’s move on to combo boxes.
Combo boxes are a little more complex to prototype. I’m not going to repeat the same steps from the dropdown menu, but we are going to concentrate on the differences.
One thing to mention before moving on is that in our case, we will use a global variable to temporarily store a selection value. We can avoid doing this by creating a hidden Label widget to hold this temporary value (this option can be explored by you if you want).
In this second part, we will create a simple combo box. There are multiple variations of this type of control, but the principles shown here can be applied to any variation. If you want to learn more about this control type, you can take a look at the Apple HIG for combo boxes here.
The level of difficulty is easy to medium. Everything was broken into 2 steps, so you could follow along more easily.
The structure for this combo box is similar to the dropdown, so we will concentrate on what is different.
First off, I’ve replaced the “selected_value” Label with a Text Field named “input_value”. We will use this input field to allow the user to input any number (eg: 1,2,3,4,5 and so on). Once the user has finished with the input on the Lost Focus event, we will reformat the render to be displayed as “X lbs”, where the X is the number input.
I’ve also added 2 more shapes:
The first interaction is added to the dropdown_hotspot (which is the same as the dropdown menu dropdown_selection group) on the Click or Tap event to Show/Hide the list of values but also to Rotate the dropdown arrow accordingly.
Most of the interactivity happens on the input_value Text Field we will respond to the Got Focus/Lost Focus events and, optionally, to the Loaded event.
Let’s see what is happening, we have some actions on the Got Focus/Lost Focus events to handle the user input, so while the input_value Got Focus we will clear the existing value (this is the reason why we need the input_value_var to simply hold the current value) and wait for user input, now the tricky part is on the Lost Focus event, here we need to check if the user has typed a new value, or he simply exits without any change and to properly handle this in Axure we make use of Cases/Conditions. You can learn more about Conditional Logic on the Axure website.
Below are the action details for each event (FYI: the current widget is input_value).
The last interaction is on the option_value item from the Repeater on the Click or Tap event to respond to the changing of the selection(option) which is the same as on the dropdown menu.
Yee! That’s it!
Creating a dropdown menu is easy in Axure but the combo box can be a little challenging. I hope this tutorial helps you to easily tackle dropdown menus and combo boxes.
Written by: Lucian Dinu
© 2020 - 2023 InteractiveCTRL