Select field
A dropdown, providing the user with options to choose from.
Default select field orc-c-field
A dropdown, providing the user with options to choose from.
Select field error has-error
Lets the user know that their selection can’t be registered in our system.
Select field valid is-valid
Lets the user know that their selection is valid and was registered.
Disabled select field is-disabled
Shows that user can’t interact with the checkbox.
-
<div class="orc-c-field orc-js-field"> <label for="" class="orc-c-field__label">Label</label> <div class="orc-c-field__body"> <select class="orc-c-select" id="" name="" placeholder="Placeholder"> <option value="option-1" >Option 1</option> <option value="option-2" >Option 2</option> </select> <!--end orc-c-select--> </div> <!-- end orc-c-field__body --> <div class="orc-c-field__note orc-js-field-note">This is a note about the field</div> </div> <!-- end orc-c-field -->
-
<div class="orc-c-field orc-has-error orc-js-field"> <label for="" class="orc-c-field__label">Label</label> <div class="orc-c-field__body"> <select class="orc-c-select" id="" name="" placeholder="Placeholder"> <option value="option-1" >Option 1</option> <option value="option-2" >Option 2</option> </select> <!--end orc-c-select--> </div> <!-- end orc-c-field__body --> <div class="orc-c-field__note orc-js-field-note">This is an invalid message</div> </div> <!-- end orc-c-field -->
-
<div class="orc-c-field orc-is-valid orc-js-field"> <label for="" class="orc-c-field__label">Label</label> <div class="orc-c-field__body"> <select class="orc-c-select" id="" name="" placeholder="Placeholder"> <option value="option-1" >Option 1</option> <option value="option-2" >Option 2</option> </select> <!--end orc-c-select--> </div> <!-- end orc-c-field__body --> <div class="orc-c-field__note orc-js-field-note">This is a valid message</div> </div> <!-- end orc-c-field -->
-
<div class="orc-c-field orc-is-disabled orc-js-field"> <label for="" class="orc-c-field__label">Label</label> <div class="orc-c-field__body"> <select class="orc-c-select" id="" name="" placeholder="Placeholder" disabled> <option value="option-1" >Option 1</option> <option value="option-2" >Option 2</option> </select> <!--end orc-c-select--> </div> <!-- end orc-c-field__body --> <div class="orc-c-field__note orc-js-field-note">This is a disabled message</div> </div> <!-- end orc-c-field -->
Usage
When to use
Use this component liberally on our sites when giving the user many (4+) options to choose from.
When to consider an alternative
A radio field could be preferential when where are only 2 or 3 options, especially when the user has a long series of selections to make (as on their profile page).
Class Name | Description |
---|---|
Required
|
Apply to the select field’s containing HTML element. This contains the field label, field body, and field note. |
JS
|
Added to |
Modifier
|
Added to |
Modifier
|
Added to |
Modifier
|
Added to |
Required
|
Word or short phrase applied to an |
Required
|
Container used to house the select items |
Required
|
Select input that contains a list of |
|
Short excerpt that adds additional directions or context to the select field. |