JSFiddle - React, Tailwind, and code Playground
HTML
<header>
<span class="notify-icon"></span>
<div class="notify-box">
<div class="header">Notifications</div>
<div class="content">
<a href="one"></a>
<a href="two"></a>
<a href="three"></a>
<a href="four"></a>
<a href="five"></a>
<a href="sixe"></a>
</div>
</div>
</header>
CSS
body {
background: #CCC;
margin: 0;
padding: 0;
}
header {
width: 100%;
height: 60px;
padding: 15px;
background: blue;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-o-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
}
.notify-icon {
display: block;
width: 30px;
height: 30px;
background: #000;
cursor: pointer;
z-index: 9999;
position: relative;
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.notify-box {
width: 200px;
background: #FFF;
position: absolute;
top: 50px;
left: 0;
opacity: 0;
z-index: 9998;
-webkit-transition: all 0.15s;
-moz-transition: all 0.15s;
-o-transition: all 0.15s;
-ms-transition: all 0.15s;
transition: all 0.15s;
}
.notify-box.show {
top: 70px;
opacity: 1;
}
.notify-box:before {
content: '';
position: absolute;
top: -20px;
left: 20px;
width: 0;
height: 0;
border-left: 10px solid transparent;
border-right: 10px solid transparent;
border-bottom: 20px solid #FFF;
}
.notify-box .header {
width: 100%;
height: 30px;
line-height: 30px;
border-bottom: 1px solid rgba(0,0,0,0.2);
padding: 0 8px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-o-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
}
.notify-box .content {
width: 100%;
height: 306px;
overflow: auto;
}
.notify-box a {
display: block;
width: 100%;
height: 50px;
border-bottom: 1px solid rgba(0,0,0,0.2);
}
JavaScript
// Notify Box
$(".notify-icon").click(function(){
$(".notify-box").toggleClass('show');
$(this).toggleClass('show');
});