A selectable menu list from which a user can make a single selection. Typically they are used when there are more than four possible options. The custom select menu styling is achieved by wrapping the select tag within the .s-select class.
Classes
Class
Description
Parent
Modifies
.s-select
Base select style.
N/A
N/A
.s-select__sm
Apply a small size.
N/A
.s-select
.s-select__lg
Apply a large size.
N/A
.s-select
.has-error
Apply an error state.
N/A
.s-select
.has-success
Apply a success state.
N/A
.s-select
.has-warning
Apply a warning state.
N/A
.s-select
Base style
<divclass="s-form-group"><labelclass="s-label"for="select-menu">
How will you be traveling?
<pclass="mt2 s-description">Select the transportation method you will be using to come to the event.</p></label><divclass="s-select"><selectid="select-menu"><optionvalue=""selected>Please select one…</option><optionvalue="walk">Walk</option><optionvalue="bike">Bicycle</option><optionvalue="car">Automobile</option><optionvalue="rail">Train</option><optionvalue="fly">Plane</option></select></div></div><divclass="s-form-group is-disabled"><labelclass="s-label"for="select-menu-disabled">Where are you staying?</label><divclass="s-select"><selectid="select-menu-disabled"disabled><optionvalue=""selected>Please select one…</option><optionvalue="bronx">Bronx</option><optionvalue="brooklyn">Brooklyn</option><optionvalue="manhattan">Manhattan</option><optionvalue="queens">Queens</option><optionvalue="staten-island">Staten Island</option></select></div></div>
Validation states
Validation states provides the user feedback based on their interaction (or lack of interaction) with a select menu. These styles are applied by applying the appropriate class to the wrapping parent container.
Validation classes
Class
Description
Applies to
.has-warning
Used to warn users that the value they've entered has a potential problem, but it doesn't block them from proceeding.
Parent element
.has-error
Used to alert users that the value they've entered is incorrect, not filled in, or has a problem which will block them from proceeding.
Parent element
.has-success
Used to notify users that the value they've entered is fine or has been submitted successfully.
Parent element
Validation examples
Warning
<divclass="s-form-group has-warning"><labelclass="s-label"for="select-menu">
How will you be traveling?
<pclass="mt2 s-description">Select the transportation method you will be using to come to the event.</p></label><divclass="s-select"><selectid="select-menu"><optionvalue=""selected>Please select one…</option>
…
</select><svgclass="svg-icon s-input-icon"aria-hidden="true">…</svg></div></div>
Error
<divclass="s-form-group has-error"><labelclass="s-label"for="select-menu">
How will you be traveling?
<pclass="mt2 s-description">Select the transportation method you will be using to come to the event.</p></label><divclass="s-select"><selectid="select-menu"><optionvalue=""selected>Please select one…</option>
…
</select><svgclass="svg-icon s-input-icon"aria-hidden="true">…</svg></div></div>
Success
<divclass="s-form-group has-success"><labelclass="s-label"for="select-menu">
How will you be traveling?
<pclass="mt2 s-description">Select the transportation method you will be using to come to the event.</p></label><divclass="s-select"><selectid="select-menu"><optionvalue=""selected>Please select one…</option>
…
</select><svgclass="svg-icon s-input-icon"aria-hidden="true">…</svg></div></div>