2.12.7 #Components.dropdown.subtext Dropdown with sub text in the items
JavaScript is required for:
- Filtering the menu items based on the search input
- Highlighting items
Browser support: IE10+, Safari6+, Firefox30+, Chrome30+
Markup
<div class="sb-form-control">
<label class="sb-label" for="dropdown-create-items-function">Dropdown with sub text</label>
<div class="sb-dropdown sb-dropdown--open">
<div class="sb-dropdown__button sb-form-control__input sb-form-control__input--icon-right">
<button class="sb-input" id="dropdown-create-items-function" aria-haspopup="true" aria-invalid="false" aria-expanded="true">Please select...</button>
<svg viewBox="0 0 11 6" class="sb-icon sb-icon--s sb-icon--arrow-dropdown">
<path d="M5.5 6.793l4.146-4.147a.5.5 0 0 1 .708.708l-4.5 4.5a.5.5 0 0 1-.708 0l-4.5-4.5a.5.5 0 0 1 .708-.708L5.5 6.793z" id="a"/>
</svg>
</div>
<ul id="dropdown-create-items-function-menu" class="sb-dropdown__menu" role="listbox" tabindex="-1" aria-live="assertive" aria-controls="dropdown-create-items-function-menu-no-result-message">
<li class="sb-dropdown__search" role="search"><input class="sb-input" id="dropdown-create-items-function-menu-search-input" placeholder="Search here..." value="" data-com.onepassword.iv=""></li>
<li class="sb-dropdown__menu-item sb-text--milo" role="option" tabindex="-1" data-value="1" aria-posinset="1" aria-setsize="6" aria-selected="false">Choice 1
<div class="sb-text--milo sb-text--s sb-color-light-1">
Exit Survey October 18
</div>
</li>
<li class="sb-dropdown__menu-item sb-text--milo" role="option" tabindex="-1" data-value="2" aria-posinset="2" aria-setsize="6" aria-selected="false">Choice 2
<div class="sb-text--milo sb-text--s sb-color-light-1">
Exit Survey October 18
</div>
</li>
<li class="sb-dropdown__menu-item sb-text--milo" role="option" tabindex="-1" data-value="3" aria-posinset="3" aria-setsize="6" aria-selected="false">Choice 3
<div class="sb-text--milo sb-text--s sb-color-light-1">
Exit Survey October 18
</div>
</li>
<li class="sb-dropdown__menu-item sb-text--milo" role="option" tabindex="-1" data-value="10" aria-posinset="4" aria-setsize="6" aria-selected="false">Choice 10
<div class="sb-text--milo sb-text--s sb-color-light-1">
Exit Survey October 18
</div>
</li>
<li class="sb-dropdown__menu-item sb-text--milo" role="option" tabindex="-1" data-value="20" aria-posinset="5" aria-setsize="6" aria-selected="false">Choice 20
<div class="sb-text--milo sb-text--s sb-color-light-1">
Exit Survey October 18
</div>
</li>
<li class="sb-dropdown__menu-item sb-text--milo" role="option" tabindex="-1" data-value="30" aria-posinset="6" aria-setsize="6" aria-selected="false">Choice 30
<div class="sb-text--milo sb-text--s sb-color-light-1">
Exit Survey October 18
</div>
</li>
</ul>
</div>
</div>
Source: components/_dropdown.scss, line 460