Text boxes allow the user to input a simple text value. A text box only allows for a single line of input.
Input masks
Input masks ensure that the user understands the input format required, in addition to making input less error-prone by potentially restricting the number or types of characters that can be entered.
Example uses https://github.com/RobinHerbots/jquery.inputmask for demo purposes.
Text area
Purpose
Users need to input an extended, potentially multi-line text value.
Description
Text areas allow the user to input extended, multi-line text values.
Sizing and resizing
Text areas can either
have a fixed, static height
automatically grow/shrink based on the input, from a minimum number of lines (e.g., 3) to a maxmimum number of lines (e.g., 10) to ensure that space is optimally used
have a resize handle, allowing for manual vertical and/or horizontal resizing
Radio buttons
Purpose
Users must choose between two or more mutually exclusive options.
Description
Radio buttons come in a group of two or more mutually exclusive options
A radio button is either checked or unchecked
There can only be one radio button checked in a group
Radio button labels should use sentence casing
Use concise labels
Provide an initially checked option when the field is not required and/or there is a sane default
Align vertically when possible
Align in shorter columns if there are many options
Ensure there is adequate spacing between adjacent fields and radio/checkbox groups
Vertical
Inline
Modern BETA
Image-based radio buttons may be used as an alternative to the default browser interaction by adding .flair
Checkboxes
Purpose
Users need to specify which option(s) from a set are applicable/valid/true based on a label.
Description
A set of checkboxes are used when a user is able to select none, one, or multiple options
A single checkbox is used when a user is able to select or not select an option
When clicked, a checkbox’s state toggles between unchecked and checked
Checkboxes can have an indeterminate state that is set based on external interactions (e.g., indicating that some but not all items in a collection are selected)
Checkbox labels should use sentence casing
Use concise labels
Align vertically when possible
Align in shorter columns if there are many options
The selected state of a checkbox should ideally indicate something ‘positive’ and may require the rephrasing of the label (e.g., Send me weekly reminders, vs. Do not send me weekly reminders)
Ensure there is adequate spacing between adjacent fields and radio/checkbox groups
Vertical
Inline
Modern BETA
Image-based checkboxes may be used as an alternative to the default browser interaction by adding .flair
Toggle switches
Purpose
Users need to toggle an option between on/off or yes/no.
Description
Use a toggle switch for a binary option where the change occurs immediately. Use a checkbox instead if the user has to perform other actions for the change to be effective (e.g., pressing Save or Submit).
Select
Purpose
The user needs to choose an option from a predefined set.
Description
A select, sometimes referred to as a combo box, provides functionality for choosing an option from a set
It is similar to dropdown button but facilitates item selection, filtering, and reflects the currently selected value
When clicked, the user is shown all available options and can make a selection
When a selection is made, the dropdown closes and the select control updates to reflect the current selection
If there are 5 or more options, the list should allow for filtering via a text field
For empty selects, use a placeholder in the format of Select a [type]... or Select...
Example uses https://github.com/ivaynberg/select2 for demo purposes.
Multi-select
This is the native browser multi-select. ctrl+click (or cmd+click) toggles selection on an item. shift+click performs a range selection. A single click sets the selection to only that item.
Date picker
Depending on the JS library used for the date picker, functionality may vary.
Date pickers can provide:
Navigating years and months via previous/next arrows and/or other dropdowns
Multi-calendar views
Range highlighting
Min and max allowable dates
Highlighting/disabling of days/rows/columns (e.g., disable weekends or highlight bi-week)
Ability to type date as well as use a calendar dropdown
Example uses jQuery UI for demo purposes.
Time picker
Depending on the JS library used for the time picker, functionality may vary.
Time pickers can provide:
Up/down keyboard selection
Incremental time selection (example: 10min/15min/30min/45min)
Depending on the JS library used for the slider, functionality may vary.
Sliders can provide:
Min and max allowable values
Visible ticks (or pips)
Step increments
Multi-handle range
Example uses https://github.com/leongersen/noUiSlider for demo purposes.
Rich text editor
The rich text editor allows for text input with additional formatting and inline images/links. Only include the functionality/buttons/tools necessary for the specific purpose.