Table of Contents |
---|
...
Usage & Behavior
General guidelines
Structure
The drop-down consists of:
...
Options - must include a text label, but can additionally have an icon. Keep the labels short, because the list uses single lines only.
In case selecting an option is not mandatory, a No selection item should appear at the top of the options list. This will allow users to avoid selection or deselect a previously selected option.
Selection indicator - a blue check mark should be shown to the left of the selected option.
Action icons (optional) - these add extra actions for each list option, and appear on hover. A tooltip describing the action should be displayed on hoveruser interaction.
Status icons (optional) - these add extra information for each list option and always appear.
Dividers or group headers may also be used to organise the options list.
Text labels only | |
Including a No selection option | |
With icons | |
With additional actions and group divider | |
With group headers |
Default State
The drop-down trigger area consists of a text box showing the default option, if one exists. For example:
...
State | Visual | |
---|---|---|
Regular | ||
Hover | ||
Active | ||
Selected | ||
Disabled | ||
Read-Only | ||
Error | ||
Warning | ||
Focused | ||
Focused, Hover | ||
Focused, Active | ||
Focused, Disabled |
...
Interaction | Visual | Details | |||
---|---|---|---|---|---|
Hovering anywhere on the trigger area |
| ||||
Clicking anywhere on the trigger area |
| ||||
Selecting an option |
| ||||
Viewing options list with an existing selection |
| ||||
Selecting a No selection option |
| Clicking anywhere outside the drop-down |
| ||
Clicking anywhere outside the drop-down |
| ||||
Focusing or hovering on a list option when its row contains action and status icons |
| ||||
Focusing or hovering over an action or status icon |
|
Searchable drop-down
A Search field should be added:
...
Interaction | Visual | Details |
---|---|---|
Click the trigger area |
| |
Enter Search |
| |
Select an option |
| |
Delete search string |
|
Validations and errors
Please refer to the Field Validation page for more information.
A drop-down with a warning:
...
Use when:
The options list is small-medium in size.
Space is constrained.
Use the searchable type when:
there are more than 15 options.
when users are expected to know what they are looking for, and are likely to be aware of how the option is labelled.
Don’t use when:
The list has fewer than 3 options.
The list has fewer than 7 options and the user needs to see them all at once → use /wiki/spaces/UX/pages/299860272 or Checkboxes instead.
The user needs to enter a value which is not in the list → use a /wiki/spaces/UX/pages/299860272 instead.
The list is large → use Dual List Selector or List instead.
General:
Only show a scrollbar when the list has over 8 items.
Keep the text values as short as possible, because the list uses single lines only.
There is no horizontal scrolling in the option list.
The options list should adapt its length to the longest entry by default, but values which are too long may be truncated, with a tooltip displaying the full text (not recommended).
Place options that represent All or None at the beginning of the list, regardless of the sort order of the remaining items.
Do not allow the control to auto-adjust based on the selection.
If there’s no preceding label, or if the label is not indicative enough, the {NameOfEntity} should be added within the drop-down, after the number of selections. For example, 2 categories selected:
Accessibility Compliance
Unless otherwise specified, see our general compliance information in Fundamentals - Accessibility.
...
Keyboard | Trigger area | Options list |
---|---|---|
Tab | Navigates to the next component. |
|
Shift + Tab | Navigates to the previous component. |
|
Space | Opens the menu. |
|
Enter | Opens the menu. |
|
Esc | N/A | Closes the menu without updating the selection. |
Arrows | Up/Down - Opens the menu. |
Holding down the key will scroll continuously. |
Page Up/Home | N/A | Navigates to the first item. |
Page Down/End | N/A | Navigates to the last item. |
...
Zeplin Link | Screen Thumbnail |
---|---|
Code
Html macro | ||
---|---|---|
| ||
<link rel="stylesheet" href="https://ux.verint.com/bootstrap-4.0.0/dist/fonts/css/verint_lux.css"> <link rel="stylesheet" href="https://ux.verint.com/bootstrap-4.0.0/dist/css/bootstrap.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <script src="https://ux.verint.com/bootstrap-4.0.0/dist/js/bootstrap.bundle.js"></script> <script src="https://ux.verint.com/bootstrap-4.0.0/dist/other/bootstrap-tooltip-custom-class.js"></script> <script src="https://ux.verint.com/bootstrap-4.0.0/dist/other/accessibility.js"></script> <script src="https://ux.verint.com/bootstrap-4.0.0/dist/other/prism.min.js"></script> <link rel="stylesheet" href="https://ux.verint.com/bootstrap-4.0.0/dist/other/prism-coy.min.css"> <script> $(function () { $('[data-toggle="tooltip"], [data-toggle-second="tooltip"]').tooltip({trigger: 'hover', delay: { "show": 100, "hide": 0 }}); $('.is-invalid, .is-warning').on('shown.bs.tooltip', function () { var x = $(this).offset().left + $(this).width(); var y = $(this).offset().top; $('.bs-tooltip-right').css('transform', 'translate3d('+x+'px, '+y+'px, 0px)'); }); }); </script> <div class="card"> <div class="card-header">Menu Button <button id="toggleMarkup" type="button" class="btn btn-sm btn-outline-primary btn btn-fixed-width float-right m-0" onclick="$('pre' ).toggle()">Toggle Markup</button></div> <div class="card-body"> <form> <div class="form-group row"> <label for="inputKey" class="col-lg-2 col-form-label col-form-label-sm">Regular</label> <div class="col-lg-4"> <button class="btn btn-outline-light btn-sm btn-fixed-width dropdown-toggle menu-dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Menu</button> <div class="dropdown-menu dropdown-menu-sm"> <a class="dropdown-item" href="#">First Option</a> <a class="dropdown-item selected" href="#">Second Option</a> <a class="dropdown-item" href="#">Third Option</a> <a class="dropdown-item" href="#">Fourth Option</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="#">Fifth Option</a> </div> </div> <div class="col-lg-6"> <pre class="language-html"><code><script type="prism-html-markup"><button class="btn btn-outline-light btn-sm btn-fixed-width dropdown-toggle menu-dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Menu</button> <div class="dropdown-menu dropdown-menu-sm"> <a class="dropdown-item" href="#">First Option</a> <a class="dropdown-item selected" href="#">Second Option</a> <a class="dropdown-item" href="#">Third Option</a> <a class="dropdown-item" href="#">Fourth Option</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="#">Fifth Option</a> </div></script></code></pre> </div> </div> <div class="form-group row"> <label for="inputKey" class="col-lg-2 col-form-label col-form-label-sm">Disabled</label> <div class="col-lg-4"> <button class="btn btn-outline-light btn-sm btn-fixed-width dropdown-toggle menu-dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" disabled>Menu</button> <div class="dropdown-menu dropdown-menu-sm"> <a class="dropdown-item" href="#">First Option</a> <a class="dropdown-item selected" href="#">Second Option</a> <a class="dropdown-item" href="#">Third Option</a> <a class="dropdown-item" href="#">Fourth Option</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="#">Fifth Option</a> </div> </div> <div class="col-lg-6"> <pre class="language-html"><code><script type="prism-html-markup"><button class="btn btn-outline-light btn-sm btn-fixed-width dropdown-toggle menu-dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" disabled>Menu</button> <div class="dropdown-menu dropdown-menu-sm"> <a class="dropdown-item" href="#">First Option</a> <a class="dropdown-item selected" href="#">Second Option</a> <a class="dropdown-item" href="#">Third Option</a> <a class="dropdown-item" href="#">Fourth Option</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="#">Fifth Option</a> </div></script></code></pre> </div> </div> <div class="form-group row"> <label for="inputKey" class="col-lg-2 col-form-label col-form-label-sm">Error</label> <div class="col-lg-4"> <button class="btn btn-outline-light btn-sm btn-fixed-width dropdown-toggle menu-dropdown-toggle is-invalid" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" data-toggle-second="tooltip" data-custom-class="input-error" data-placement="right" title="There is an Error on the Menu Button">Menu</button> <div class="dropdown-menu dropdown-menu-sm"> <a class="dropdown-item" href="#">First Option</a> <a class="dropdown-item selected" href="#">Second Option</a> <a class="dropdown-item" href="#">Third Option</a> <a class="dropdown-item" href="#">Fourth Option</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="#">Fourth Option</a> </div> </div> <div class="col-lg-6"> <pre class="language-html"><code><script type="prism-html-markup"><button class="btn btn-outline-light btn-sm btn-fixed-width dropdown-toggle menu-dropdown-toggle is-invalid" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" data-toggle-second="tooltip" data-custom-class="input-error" data-placement="right" title="There is an Error on the Menu Button">Menu</button> <div class="dropdown-menu dropdown-menu-sm"> <a class="dropdown-item" href="#">First Option</a> <a class="dropdown-item selected" href="#">Second Option</a> <a class="dropdown-item" href="#">Third Option</a> <a class="dropdown-item" href="#">Fourth Option</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="#">Fifth Option</a> </div></script></code></pre> </div> </div> <div class="form-group row"> <label for="inputKey" class="col-lg-2 col-form-label col-form-label-sm">Warning</label> <div class="col-lg-4"> <button class="btn btn-outline-light btn-sm btn-fixed-width dropdown-toggle menu-dropdown-toggle is-warning" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" data-toggle-second="tooltip" data-custom-class="input-warning" data-placement="right" title="There is a Warning on the Menu Button">Menu</button> <div class="dropdown-menu dropdown-menu-sm"> <a class="dropdown-item" href="#">First Option</a> <a class="dropdown-item selected" href="#">Second Option</a> <a class="dropdown-item" href="#">Third Option</a> <a class="dropdown-item" href="#">Fourth Option</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="#">Fourth Option</a> </div> </div> <div class="col-lg-6"> <pre class="language-html"><code><script type="prism-html-markup"><button class="btn btn-outline-light btn-sm btn-fixed-width dropdown-toggle menu-dropdown-toggle is-warning" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" data-toggle-second="tooltip" data-custom-class="input-warning" data-placement="right" title="There is a Warning on the Menu Button">Menu</button> <div class="dropdown-menu dropdown-menu-sm"> <a class="dropdown-item" href="#">First Option</a> <a class="dropdown-item selected" href="#">Second Option</a> <a class="dropdown-item" href="#">Third Option</a> <a class="dropdown-item" href="#">Fourth Option</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="#">Fifth Option</a> </div></script></code></pre> </div> </div> </form> </div> </div> |
...