JSFiddle - React, Tailwind, and code Playground
Fliplet Select Style - TWu
by Hugo Carneiro
HTML
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<div class="form-horizontal">
<div class="form-group">
<div class="col-sm-4 control-label">
<label for="select-menu">Select a data source</label>
</div>
<div class="col-sm-8">
<label for="select_datasource" class="select-proxy-display">
<select name="select_datasource" id="select_datasource" data-label="select" class="hidden-select form-control" disabled>
<option selected value="">-- Select a data source --</option>
<option value="1">Sample data 1</option>
</select>
<span class="icon fa fa-chevron-down"></span>
<span class="select-value-proxy">-- Select a data source --</span>
</label>
</div>
</div>
</div>
SCSS
/* FORMS */
.form-control {
border-radius: 6px;
border: 1px solid #e4e9eb;
color: #333;
height: 44px;
line-height: 44px;
padding: 0 15px;
-webkit-box-shadow: none;
box-shadow: none;
}
/* SELECT */
.select-proxy-display {
width: 100%;
height: 44px;
margin: 0 auto;
padding: 0 44px 0 0;
background: #fff;
border: 1px solid #e4e9eb;
border-radius: 6px;
cursor: pointer;
outline: 0;
font-weight: 400;
line-height: 44px;
position: relative;
color: #333;
}
.select-proxy-display > .hidden-select {
position: absolute;
top: -1px;
bottom: -1px;
left: 0;
right: 0;
cursor: pointer;
opacity: 0;
z-index: 1;
}
.select-proxy-display > .hidden-select[disabled] {
cursor: not-allowed;
}
.select-proxy-display > .select-value-proxy {
position: absolute;
left: 0;
top: 0;
right: 42px;
bottom: 0;
padding-left: 15px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.select-proxy-display > .hidden-select[disabled] ~ .select-value-proxy {
background: #e4e9eb;
}
.select-proxy-display > .icon {
position: absolute;
width: 44px;
top: -1px;
right: -1px;
bottom: -1px;
background-color: #00abd2;
text-align: center;
line-height: 44px;
font-size: 18px;
color: #FFF;
border-top-right-radius: 6px;
border-bottom-right-radius: 6px;
border-left: 1px solid #e4e9eb;
}
JavaScript
$(document).on('change', '.hidden-select', function(){
var selectedValue = $(this).val();
var selectedText = $(this).find("option:selected").text();
$(this).parents('.select-proxy-display').find('.select-value-proxy').text(selectedText);
});