Search Inputs
Default
- The Magnifying Glass Icon in Search Design: Pros and Cons – Nielsen Norman Group
<div class="adb-search_field adb-input_row adb-js-input_row"> <div class="adb-input_row--item adb-input_row--primary"> <input class="adb-search_field--input adb-text__small adb-input_row--item_content" placeholder="Search" type="search"> </div> <div class="adb-input_row--item"> <button class="adb-button__square_small adb-input_row--item_content"> <i class="adb-icon__search"></i> </button> </div> </div>
<div class="adb-search_field adb-input_row adb-js-input_row"> <div class="adb-input_row--item adb-input_row--primary"> <input class="adb-search_field--input adb-input_row--item_content" placeholder="Search" type="search"> </div> <div class="adb-input_row--item"> <button class="adb-button__square adb-input_row--item_content"> <i class="adb-icon__search"></i> </button> </div> </div>
<div class="adb-search_field adb-input_row adb-input_row__full_width adb-js-input_row"> <div class="adb-input_row--item adb-input_row--primary"> <input class="adb-search_field--input adb-input_row--item_content" placeholder="Search" type="search"> </div> <div class="adb-input_row--item"> <button class="adb-button__square adb-input_row--item_content"> <i class="adb-icon__search"></i> </button> </div> </div>
States
<div class="adb-search_field adb-input_row adb-js-input_row"> <div class="adb-input_row--item adb-input_row--primary"> <input class="adb-search_field--input adb-input_row--item_content" placeholder="Search" type="search"> </div> <div class="adb-input_row--item"> <button class="adb-button__square adb-input_row--item_content"> <i class="adb-icon__search"></i> </button> </div> </div>
<div class="adb-search_field adb-input_row adb-js-input_row adb-is-error"> <div class="adb-input_row--item adb-input_row--primary"> <input class="adb-search_field--input adb-input_row--item_content" placeholder="Search" type="search"> </div> <div class="adb-input_row--item"> <button class="adb-button__square adb-input_row--item_content"> <i class="adb-icon__search"></i> </button> </div> </div>
<div class="adb-search_field adb-input_row adb-js-input_row adb-is-disabled"> <div class="adb-input_row--item adb-input_row--primary"> <input class="adb-search_field--input adb-input_row--item_content" disabled placeholder="Search" type="search"> </div> <div class="adb-input_row--item"> <button class="adb-button__square adb-input_row--item_content" disabled> <i class="adb-icon__search"></i> </button> </div> </div>
These are the same as Input Rows states.
With Filters
<div class="adb-search_field adb-input_row adb-js-input_row"> <div class="adb-input_row--item"> <div class="adb-input_row--item_content adb-js-dropdown adb-dropdown adb-dropdown__inset adb-dropdown__small"> <select> <option>All</option> <option> veritatis et quasi architecto beatae </option> <option> vitae dicta sunt explicabo aspernatur </option> <option> aut odit aut fugit sed </option> </select> </div> </div> <div class="adb-input_row--item adb-input_row--primary"> <input class="adb-input_row--item_content adb-search_field--input adb-text__small" placeholder="Find Applications for Your Business" type="search"> </div> <div class="adb-input_row--item"> <button class="adb-input_row--item_content adb-button__small" type="submit"> <i class="adb-icon__search"></i> Search </button> </div> </div>
<div class="adb-search_field adb-input_row adb-js-input_row"> <div class="adb-input_row--item"> <div class="adb-input_row--item_content adb-js-dropdown adb-dropdown adb-dropdown__inset"> <select> <option>All</option> <option> sit amet consectetur adipisci velit </option> <option> sed quia non numquam eius </option> <option> modi tempora incidunt ut labore </option> </select> </div> </div> <div class="adb-input_row--item adb-input_row--primary"> <input class="adb-input_row--item_content adb-search_field--input" placeholder="Find Applications for Your Business" type="search"> </div> <div class="adb-input_row--item"> <button class="adb-input_row--item_content" type="submit"> <i class="adb-icon__search"></i> Search </button> </div> </div>
<div class="adb-search_field adb-input_row adb-input_row__full_width adb-js-input_row"> <div class="adb-input_row--item"> <div class="adb-input_row--item_content adb-js-dropdown adb-dropdown adb-dropdown__inset"> <select> <option>All</option> <option> corporis nemo enim ipsam voluptatem </option> <option> quia voluptas sit suscipit laboriosam </option> <option> nisi ut aliquid ex ea </option> </select> </div> </div> <div class="adb-input_row--item adb-input_row--primary"> <input class="adb-input_row--item_content adb-search_field--input" placeholder="Find Applications for Your Business" type="search"> </div> <div class="adb-input_row--item"> <button class="adb-input_row--item_content" type="submit"> <i class="adb-icon__search"></i> Search </button> </div> </div>
Auto-Complete Search
<div class="adb-search_field adb-search_field__auto"> <span class="adb-search_field--affix adb-search_field--affix__default"></span> <span class="adb-search_field--affix adb-search_field--affix__loading"> <span class="adb-loading"> <span class="adb-loading--text">Loading...</span> </span> </span> <input class="adb-js-auto_search--input adb-search_field--input adb-text__small" id="name-search" placeholder="Search" type="search"> <a class="adb-close adb-search_field--affix adb-search_field--affix__clear adb-js-auto_search--clear"></a> </div>
<div class="adb-search_field adb-search_field__auto"> <span class="adb-search_field--affix adb-search_field--affix__default"></span> <span class="adb-search_field--affix adb-search_field--affix__loading"> <span class="adb-loading"> <span class="adb-loading--text">Loading...</span> </span> </span> <input class="adb-js-auto_search--input adb-search_field--input" id="name-search" placeholder="Search" type="search"> <a class="adb-close adb-search_field--affix adb-search_field--affix__clear adb-js-auto_search--clear"></a> </div>
Searching with auto-complete on text inputs.
Inline Search Input
Single-line Results
<div class="adb-form--field"> <label class="adb-label__inline" for="label-inline-email"> Assign to </label> <div class="adb-search-input adb-context_menu"> <div class="adb-search-input_field adb-search-input_field__auto"> <span class="adb-search_field--affix adb-search-input_field--affix__default"></span> <span class="adb-search_field--affix adb-search-input_field--affix__loading"> <span class="adb-loading"> <span class="adb-loading--text">Loading...</span> </span> </span> <input class="adb-search-input_field--input adb-js-search-input_field--input" placeholder="Find a user" type="search"> <a class="adb-close adb-search_field--affix adb-search_field--affix__clear adb-js-search-input_field--clear"></a> <div class="adb-container adb-context_menu--menu" role="menu"> <ul class="adb-stack"> <li class="adb-stack--item"> <a class="adb-link__option adb-stack--item_content adb-js-search-input_field--item"> <span>Stephanie Aldwin</span> </a> </li> <li class="adb-stack--item"> <a class="adb-link__option adb-stack--item_content adb-js-search-input_field--item"> <span>Stephen Bruner</span> </a> </li> <li class="adb-stack--item"> <a class="adb-link__option adb-stack--item_content adb-js-search-input_field--item"> <span>Stephen Curry</span> </a> </li> <li class="adb-stack--item"> <a class="adb-link__option adb-stack--item_content adb-js-search-input_field--item"> <span>Daria Stephens</span> </a> </li> <li class="adb-stack--item"> <a class="adb-link__option adb-stack--item_content adb-js-search-input_field--item"> <span>Earl Stephens</span> </a> </li> </ul> </div> <div class="adb-container adb-js-context_menu--no_results adb-context_menu--menu"> <ul class="adb-stack"> <li class="adb-stack--item"> <span class="adb-stack--item_content adb-no-link__option">No users found.</span> </li> </ul> </div> </div> <span class="adb-tag adb-search-input_field--tag adb-js-search-input_field--tag"> <span class="adb-tag--text"></span> <a class="adb-tag--remove adb-js-search-input_field--clear"></a> </span> </div> </div>
Multi-line Results
Display large multi-line data.
<div class="adb-form--field"> <label class="adb-label__inline" for="label-inline-email"> Assign to </label> <div class="adb-search-input adb-context_menu"> <div class="adb-search-input_field adb-search-input_field__auto"> <span class="adb-search_field--affix adb-search-input_field--affix__default"></span> <span class="adb-search_field--affix adb-search-input_field--affix__loading"> <span class="adb-loading"> <span class="adb-loading--text">Loading...</span> </span> </span> <input class="adb-search-input_field--input adb-js-search-input_field--input" id="user-search" placeholder="Find a user" type="search"> <a class="adb-close adb-search_field--affix adb-search_field--affix__clear adb-js-search-input_field--clear"></a> <div class="adb-container adb-context_menu--menu" role="menu"> <ul class="adb-stack"> <li class="adb-stack--item"> <a class="adb-link__option adb-stack--item_content adb-js-search-input_field--item"> <span> Stephanie Aldwin </span> <div class="adb-subtitle"> stephanie.aldwin@gmail.com </div> </a> </li> <li class="adb-stack--item"> <a class="adb-link__option adb-stack--item_content adb-js-search-input_field--item"> <span> Stephen Bruner </span> <div class="adb-subtitle"> stephen.bruner@gmail.com </div> </a> </li> <li class="adb-stack--item"> <a class="adb-link__option adb-stack--item_content adb-js-search-input_field--item"> <span> Stephen Curry </span> <div class="adb-subtitle"> steph.curry@gmail.com </div> </a> </li> <li class="adb-stack--item"> <a class="adb-link__option adb-stack--item_content adb-js-search-input_field--item"> <span> Daria Stephens </span> <div class="adb-subtitle"> daria.stephens@gmail.com </div> </a> </li> <li class="adb-stack--item"> <a class="adb-link__option adb-stack--item_content adb-js-search-input_field--item"> <span> Earl Stephens </span> <div class="adb-subtitle"> earl.stephens@gmail.com </div> </a> </li> </ul> <div class="adb-container adb-js-context_menu--no_results adb-context_menu--menu"> <ul class="adb-stack"> <li class="adb-stack--item"> <span class="adb-stack--item_content adb-no-link__option">No users found.</span> </li> </ul> </div> </div> </div> <span class="adb-tag adb-search-input_field--tag adb-js-search-input_field--tag"> <span class="adb-tag--text"></span> <a class="adb-tag--remove adb-js-search-input_field--clear"></a> </span> </div> </div>
Multi-select Results
Setting the return method to data-return_method="multiline_tag_results"
will display multiple results as tags.
<div class="adb-form--field"> <div class="adb-search-input adb-context_menu"> <div class="adb-search-input_field adb-search-input_field__auto"> <span class="adb-search_field--affix adb-search-input_field--affix__default"></span> <span class="adb-search_field--affix adb-search-input_field--affix__loading"> <span class="adb-loading"> <span class="adb-loading--text">Loading...</span> </span> </span> <input class="adb-search-input_field--input adb-js-search-input_field--input" data-return-method="multiline_tag_results" data-return-text="Selected " data-text="Find an application" placeholder="Find an application" type="search"> <a class="adb-close adb-search_field--affix adb-search_field--affix__clear adb-js-search-input_field--clear"></a> <div class="adb-container adb-context_menu--menu adb-complex_tooltip" data-hide-arrow="false" data-max-size="medium" data-overflow="scroll" data-placement="bottom" role="menu"> <form class="adb-form"> <ul class="adb-stack"> <li class="adb-stack--item-grouped adb-js-search-input_container"> <a class="adb-link__option adb-stack--item_content"> <label class="adb-selector adb-js-checkbox" for="multiline_results_example_code_1_1"> <span class="adb-selector--input"> <input id="multiline_results_example_code_1_1" name="multiline_results_example_code_1_1" type="checkbox"> </span> <span class="adb-selector--value"> <i class="adb-icon"> <img class="adb-icon-logo" src="../../images/logos/apps/cakemail-72x72.png?1567620427" /> </i> <span class="adb-js-search-input_field--item"> <span> Developer Beat </span> </span> </span> </label> </a> </li> </ul> <ul class="adb-stack adb-js-context_menu--no_results adb-is-hidden"> <li class="adb-stack--item-grouped"> <div class="adb-stack--item_content adb-js-checkbox"> <span class="adb-stack--item_content adb-no-link__option">No Applications found.</span> </div> </li> </ul> </form> </div> </div> <span class="adb-tag adb-search-input_field--tag adb-js-search-input_field--tag"> <span class="adb-tag--text"></span> <a class="adb-tag--remove adb-js-search-input_field--clear"></a> </span> </div> </div>
<div class="adb-form--field"> <div class="adb-search-input adb-context_menu"> <div class="adb-search-input_field adb-search-input_field__auto"> <span class="adb-search_field--affix adb-search-input_field--affix__default"></span> <span class="adb-search_field--affix adb-search-input_field--affix__loading"> <span class="adb-loading"> <span class="adb-loading--text">Loading...</span> </span> </span> <input class="adb-search-input_field--input adb-js-search-input_field--input" data-return-method="multiline_tag_results" data-return-text="Selected " data-text="Find an application" placeholder="Find an application" type="search"> <a class="adb-close adb-search_field--affix adb-search_field--affix__clear adb-js-search-input_field--clear"></a> <div class="adb-container adb-context_menu--menu adb-complex_tooltip" data-hide-arrow="false" data-max-size="medium" data-overflow="scroll" data-placement="bottom" role="menu"> <form class="adb-form"> <div class="adb-js-tags_field adb-tags_select_all"> <div class="adb-tags_field--subcategory adb-js-tags_field--subcategory adb-tags_field--subcategory--selectall"> <ul class="adb-stack"> <li class="adb-stack--item-grouped adb-js-search-input_container"> <a class="adb-link__option adb-stack--item_content"> <label class="adb-selector adb-js-checkbox adb-selector-selectall" for="selectAll_multiline_results_select_all_code"> <span class="adb-selector--input"> <input id="selectAll_multiline_results_select_all_code" type="checkbox" value="Select All"> </span> <span class="adb-js-search-input_field--item"> <span> Select All </span> </span> </label> </a> </li> <li class="adb-stack--item-grouped adb-js-search-input_container"> <a class="adb-link__option adb-stack--item_content"> <label class="adb-selector adb-js-checkbox" for="multiline_results_select_all_code_1_1"> <span class="adb-selector--input"> <input id="multiline_results_select_all_code_1_1" name="multiline_results_select_all_code_1_1" type="checkbox"> </span> <span class="adb-selector--value"> <i class="adb-icon"> <img class="adb-icon-logo" src="../../images/logos/apps/cakemail-72x72.png?1567620427" /> </i> <span class="adb-js-search-input_field--item"> <span> Web Eye </span> </span> </span> </label> </a> </li> </ul> <ul class="adb-stack adb-js-context_menu--no_results adb-is-hidden"> <li class="adb-stack--item-grouped"> <div class="adb-stack--item_content adb-js-checkbox"> <span class="adb-stack--item_content adb-no-link__option">No Applications found.</span> </div> </li> </ul> </div> </div> </form> </div> </div> <span class="adb-tag adb-search-input_field--tag adb-js-search-input_field--tag"> <span class="adb-tag--text"></span> <a class="adb-tag--remove adb-js-search-input_field--clear"></a> </span> </div> </div>
Search Inputs in a Dropdown Selector
There are three return methods that a search input can provide on a context menu selector. A long list of all results or a truncated list or just the total number of selected items.
Return Methods
Example | Data-Attribute "data-return-method" |
---|---|
|
multiline_results
|
<menu class="adb-context_menu adb-js-context_menu adb-search-input"> <button class="adb-context_menu--trigger adb-js-context_menu--trigger" data-menu-type="autocomplete" type="button"> Find an application </button> <div class="adb-container adb-context_menu--menu adb-js-context_menu--menu" role="menu"> <div class="adb-complex_tooltip adb-is-visible" data-hide-arrow="true" data-placement="bottom" data-size="fluid"> <div class="adb-js-context_menu--interactionable"> <div class="adb-search-input"> <div class="adb-search-input_field adb-search-input_field__auto adb-search_field__small adb-search-input--content"> <span class="adb-search_field--affix adb-search-input_field--affix__default" data-align="top"></span> <span class="adb-search_field--affix adb-search-input_field--affix__loading" data-align="top"> <span class="adb-loading"> <span class="adb-loading--text">Loading...</span> </span> </span> <input class="adb-search-input_field--input adb-js-search-input_field--input" data-return-method="multiline_results" data-return-text-max="20" data-return-text="Selected: " placeholder="Find an application" type="search"> <a class="adb-close adb-search_field--affix adb-search_field--affix__clear adb-js-search-input_field--clear" data-align="top"></a> <div class="adb-context_menu--menu" data-position="inline" data-size="fluid"> <form class="adb-form"> <ul class="adb-stack"> <li class="adb-stack--item-grouped adb-js-search-input_container"> <a class="adb-link__option adb-stack--item_content"> <label class="adb-selector adb-js-checkbox" for="multiline_results__example_1_1"> <span class="adb-selector--input"> <input id="multiline_results__example_1_1" name="multiline_results__example_1_1" type="checkbox"> </span> <span class="adb-selector--value"> <i class="adb-icon"> <img class="adb-icon-logo" src="../../images/logos/apps/cakemail-72x72.png?1567620427" /> </i> <span class="adb-js-search-input_field--item"> <span> Yukon Hammer </span> </span> </span> </label> </a> </li> </ul> <ul class="adb-stack adb-js-context_menu--no_results adb-is-hidden"> <li class="adb-stack--item-grouped"> <div class="adb-stack--item_content adb-js-checkbox"> <span class="adb-stack--item_content adb-no-link__option">No Applications found.</span> </div> </li> </ul> </form> </div> </div> </div> </div> </div> </div> </menu> |
|
|
truncated_results
data-return-text-max="20"
|
<menu class="adb-context_menu adb-js-context_menu adb-search-input"> <button class="adb-context_menu--trigger adb-js-context_menu--trigger" data-menu-type="autocomplete" type="button"> Find an application </button> <div class="adb-container adb-context_menu--menu adb-js-context_menu--menu" role="menu"> <div class="adb-complex_tooltip adb-is-visible" data-hide-arrow="true" data-placement="bottom" data-size="fluid"> <div class="adb-js-context_menu--interactionable"> <div class="adb-search-input"> <div class="adb-search-input_field adb-search-input_field__auto adb-search_field__small adb-search-input--content"> <span class="adb-search_field--affix adb-search-input_field--affix__default" data-align="top"></span> <span class="adb-search_field--affix adb-search-input_field--affix__loading" data-align="top"> <span class="adb-loading"> <span class="adb-loading--text">Loading...</span> </span> </span> <input class="adb-search-input_field--input adb-js-search-input_field--input" data-return-method="truncated_results" data-return-text-max="" data-return-text="Selected: " placeholder="Find an application" type="search"> <a class="adb-close adb-search_field--affix adb-search_field--affix__clear adb-js-search-input_field--clear" data-align="top"></a> <div class="adb-context_menu--menu" data-position="inline" data-size="fluid"> <form class="adb-form"> <ul class="adb-stack"> <li class="adb-stack--item-grouped adb-js-search-input_container"> <a class="adb-link__option adb-stack--item_content"> <label class="adb-selector adb-js-checkbox" for="truncated_results_1_1"> <span class="adb-selector--input"> <input id="truncated_results_1_1" name="truncated_results_1_1" type="checkbox"> </span> <span class="adb-selector--value"> <i class="adb-icon"> <img class="adb-icon-logo" src="../../images/logos/apps/cakemail-72x72.png?1567620427" /> </i> <span class="adb-js-search-input_field--item"> <span> Developer Beat </span> </span> </span> </label> </a> </li> </ul> <ul class="adb-stack adb-js-context_menu--no_results adb-is-hidden"> <li class="adb-stack--item-grouped"> <div class="adb-stack--item_content adb-js-checkbox"> <span class="adb-stack--item_content adb-no-link__option">No Applications found.</span> </div> </li> </ul> </form> </div> </div> </div> </div> </div> </div> </menu> |
|
|
total_number
|
<menu class="adb-context_menu adb-js-context_menu adb-search-input"> <button class="adb-context_menu--trigger adb-js-context_menu--trigger" data-menu-type="autocomplete" type="button"> Find an application </button> <div class="adb-container adb-context_menu--menu adb-js-context_menu--menu" role="menu"> <div class="adb-complex_tooltip adb-is-visible" data-hide-arrow="true" data-placement="bottom" data-size="fluid"> <div class="adb-js-context_menu--interactionable"> <div class="adb-search-input"> <div class="adb-search-input_field adb-search-input_field__auto adb-search_field__small adb-search-input--content"> <span class="adb-search_field--affix adb-search-input_field--affix__default" data-align="top"></span> <span class="adb-search_field--affix adb-search-input_field--affix__loading" data-align="top"> <span class="adb-loading"> <span class="adb-loading--text">Loading...</span> </span> </span> <input class="adb-search-input_field--input adb-js-search-input_field--input" data-return-method="total_number" data-return-text-max="" data-return-text="Selected: " placeholder="Find an application" type="search"> <a class="adb-close adb-search_field--affix adb-search_field--affix__clear adb-js-search-input_field--clear" data-align="top"></a> <div class="adb-context_menu--menu" data-position="inline" data-size="fluid"> <form class="adb-form"> <ul class="adb-stack"> <li class="adb-stack--item-grouped adb-js-search-input_container"> <a class="adb-link__option adb-stack--item_content"> <label class="adb-selector adb-js-checkbox" for="multiselect_total_number_1_1"> <span class="adb-selector--input"> <input id="multiselect_total_number_1_1" name="multiselect_total_number_1_1" type="checkbox"> </span> <span class="adb-selector--value"> <i class="adb-icon"> <img class="adb-icon-logo" src="../../images/logos/apps/cakemail-72x72.png?1567620427" /> </i> <span class="adb-js-search-input_field--item"> <span> Web Eye </span> </span> </span> </label> </a> </li> </ul> <ul class="adb-stack adb-js-context_menu--no_results adb-is-hidden"> <li class="adb-stack--item-grouped"> <div class="adb-stack--item_content adb-js-checkbox"> <span class="adb-stack--item_content adb-no-link__option">No Applications found.</span> </div> </li> </ul> </form> </div> </div> </div> </div> </div> </div> </menu> |