Selects

Form elements that are used to select one or more values from predefined data sets.

The values within a select list should be sorted in an easily scannable order (e.g. alphabetically or by popularity).

Most selects start with no selection other than a neutral default so that users are more aware of the decision.

Select List

By default, the first option in a select list is selected, and this is a neutral instruction such as "Choose one".

The <select> element is used to create a drop-down list.

The <option> tags inside the <select> element define the available options in the list.

Keyboard Operation

While dropdown is closed:

  • Tab = Select the next focusable element outside of the dropdown.
  • Shift + Tab = Select the previous focusable element outside of the dropdown.
  • Return/Enter/Space/Down Arrow = Open the dropdown with the first option selected.
  • Up Arrow = Open the dropdown with the last option selected.

While dropdown is open:

  • Down Arrow = Put the next option in focus.
  • Up Arrow = Put the previous option in focus.
  • Home = Scroll to the top and put the first option in focus.
  • End = Scroll to the bottom and put the last option in focus.
  • Return/Enter = Select the currently highlighted option and then close the dropdown.
  • Tab = Close the dropdown and select the next focusable element outside of it.
  • Shift + Tab = Close the dropdown and select the previous focusable element outside of it.
  • Esc = Select the first (default) option and close the dropdown.

Spin Box Select

Spin boxes are comprised of three components, including an editable input field that displays the current value, an increment button, and a decrement button.

It's advisable to use spin box select when working with known ranges (especially in the case of large ranges) as opposed to distinct options. For example, when selecting a range from 0 to 59 for setting the minutes values on a clock, it would perform better as a spin box rather than a lengthy select list.

If the range is large, a spin box may support changing the value in both small and large increments. In the clock example, the user may be able to move by 1 minute with Up Arrow and Down Arrow, and by 10 minutes with Page Up and Page Down.

Keyboard Operation

While spin box is in focus:

  • Up Arrow = Increase the value.
  • Down Arrow = Decrease the value.
  • Home = Sets the value to its minimum, if any.
  • End = Sets the value to its maximum, if any.
  • Page Up (Optional) = Increase the value by a larger step than Up Arrow.
  • Page Down (Optional) = Decrease the value by a larger step than Down Arrow.

For the input field component:

  • Type characters within the input. Most implementations allow only certain characters as part of the value and prevent input of any other characters. For example, a clock would allow only integer values from 0 to 59, the colon ':', and the letters 'AM' and 'PM'.
  • Any non-allowed character input should not change the contents of the input field nor the value of the spin box.
  • Include standard keyboard operation for input, cursor movement, selection, and text manipulation.
  • Standard key assignments for editing functions are specific to the device operating system.
  • The most robust approach for providing text editing functions is to rely on browsers, which supply them for HTML inputs with type text and for elements with the contenteditable HTML attribute.
  • JavaScript should not interfere with browser-provided text editing functions by capturing key events for the keys used to perform them.

Date Select

The date select consists of an input field and a datepicker component.

The datepicker should never be required for selecting a date. There should always be an input field for direct entry.

Ensure that the required format for the date is specified in the label.

It should be possible to select a date via keyboard. For example, by using tab to put the datepicker in focus and using arrow keys to pick the right date.

Keyboard Operation

While the datepicker calendar view is open:

  • Left = Move focus to the previous day. Will move to the last day of the previous month, if the current day is the first day of a month.
  • Right = Move focus to the next day. Will move to the first day of the following month, if the current day is the last day of a month.
  • Up = Move focus to the same day of the previous week. Will wrap to the appropriate day in the previous month.
  • Down = Move focus to the same day of the following week. Will wrap to the appropriate day in the following month.
  • PgUp = Move focus to the same date of the previous month. If that date does not exist, focus is placed on the last day of the month.
  • PgDn = Move focus to the same date of the following month. If that date does not exist, focus is placed on the last day of the month.
  • Alt+PgUp = Move focus to the same date of the previous year. If that date does not exist (e.g leap year), focus is placed on the last day of the month.
  • Alt+PgDn = Move focus to the same date of the following year. If that date does not exist (e.g leap year), focus is placed on the last day of the month.
  • Home = Move to the first day of the month.
  • End = Move to the last day of the month
  • Tab / Shift+Tab = If the datepicker is in modal mode, navigate between the calendar grid and the close/previous/next selection buttons, otherwise move to the field following/preceding the input field associated with the datepicker
  • Enter / Space = Fill the input field with the selected date and then close the datepicker widget.
  • Escape = Close the datepicker without making a selection.

Do's and Don'ts

Types

Variants

Common Button Labels and Usage

Title case, 2-3 words maximum.
Do not combine actions in a label (exception: "Customize & Buy").
If standard labels don't fit the button's purpose, align label with the task the user is attempting.

Please refer to the Dell Technologies branding website, https://brand.delltechnologies.com/faq/#voice, for further information regarding call-to-action labels and usage.

Button Label:
Corresponding Action:
Add to Cart
Search
Cancel
Save
Edit
Delete
Continue
Next/Previous
Submit
Select
Sign In/Sign Out
View Details
Ok/Cancel
Learn More
Close
Takes users to Cart page, with item added
Used for search buttons
Takes users back to entry point for a task
Used to save an item
Navigates users to change an item
Deletes an item on the page, usually with a verification step
Used as progression
Used as forward and backward navigation (Next is primary, Previous is secondary)
Used to submit a task or info
Used for choosing items in a task flow
Authentication standard, for consistency do not use Log In/Log Out or Signin/Signout
Used instead of “Select” in cases of product details or within learn content
For use in modal verification steps when more specific CTAs will not fit due to space
Used to link users to more learning content or contextual help
Used within modal windows

Select Lists

Standard Select List

<div class="dds__form-group"> <label for="exampleFormControlSelect3">Example select title</label> <select class="dds__form-control" id="exampleFormControlSelect3"> <option>Option 1</option> <option>Option 2</option> <option>Option 3</option> <option>Option 4</option> <option disabled="">Option 5 (disabled example)</option> </select> </div>

Disabled Select List

<div class="dds__form-group"> <label for="exampleFormControlSelectDisabled">Example select title</label> <select class="dds__form-control" id="exampleFormControlSelectDisabled" disabled=""> <option>Option 1</option> <option>Option 2</option> <option>Option 3</option> <option>Option 4</option> <option>Option 5</option> </select> </div>

No items found.

No items found.

No items found.

Redlines

Select List

Select list redlines

The W3C Web Accessibility Initiative (WAI) develops standards and support materials to help you understand and implement accessibility.

You may also refer to this article about creating accessible forms from WebAIM.

Select List

The A11Y Style Guide has excellent examples of markup for select lists.

Please follow the best practices for a listbox from WAI-ARIA authoring practices 1.1.

Please also refer to these recommendations for a listbox from WAI-ARIA 1.1.

You may refer to this example of a collapsible dropdown listbox from WAI-ARIA practices 1.1.

You may also refer to these tutorials for grouping items in select elements from Web Accessibility Tutorials.

Tiered Select List

The A11Y Style Guide has excellent examples of markup for select lists with grouping/tiers.

Please follow the best practices for a tree view from WAI-ARIA authoring practices 1.1.

Please also refer to these recommendations for trees from WAI-ARIA 1.1.

Multi-Select List

Please refer to the accessibility guidelines for checkboxes.

Spin Box Select

Please follow the best practices for a spinbutton from WAI-ARIA authoring practices 1.1.

Please also refer to these recommendations for a spinbutton from WAI-ARIA 1.1.

You may refer to this example of a date picker spin button from WAI-ARIA practices 1.1.

Date Select

Please follow the best practices for a non-modal dialog and the best practices for grids from WAI-ARIA authoring practices 1.1.

Please also refer to these recommendations for non-modal dialogs, these recommendations for grids and recommendations for the aria-current state from WAI-ARIA 1.1.

You may refer to this example of a date picker dialog from WAI-ARIA practices 1.1.