JSFiddle - React, Tailwind, and code Playground
HTML
<ul class="select">{{value}}
<ul class="options">
<li class="options-heading"><b>Options Heading</b></li>
{{#each options}}
<li>{{value}}</li>
{{/each}}
<li>Some Options</li>
</ul>
</ul>
CSS
body {font-family:Arial;font-size:11px;}
.select {
min-height:15px;
cursor:pointer;
list-style-type: none;
width:100%;
border:1px solid rgba(5,0,0,0.1);
padding:0px;
margin:0;
text-align:center;
border-radius:5px;
margin-top:5px;
margin-bottom:5px}
.select li {
padding:5px;
background:white;
border-bottom:1px solid rgba(5,0,0,0.1);
width:100%;
list-style-type: none;
max-width:200px;}
.options {
overflow-y:auto;
height:200px;
position:absolute;
width:100%;
margin:0;
padding:0px;
display:none;
background:rgba(5,0,0,0.4);
color:black;}
.option:hover, .activeselect {
background: #0183DA;
color:white}
.showblock {display:block;}
.options-heading {
background:white;
color:black;
cursor:auto;
text-transform:uppercase}
.options-expand {
position:fixed;width:100%;
height:100vh;
top:0;
left:0;
display: flex;
display: -webkit-flex;
-webkit-flex-direction: column;
flex-direction: column;
align-items:center;
-webkit-justify-content: center;
justify-content:center;}
JavaScript
$( document ).ready(function() {
$( ".select" ).click(function(event) {
if($(event.currentTarget).hasClass("activeselect")) {
$(event.currentTarget).children(".options").removeClass("showblock")
$(event.currentTarget).removeClass("activeselect")
$(event.currentTarget).children(".options").removeClass("options-expand");
} else {
$(event.currentTarget).addClass("activeselect")
$(event.currentTarget).children(".options").addClass("showblock")
$(event.currentTarget).children(".options").addClass("options-expand");
}
});
});