JSFiddle - React, Tailwind, and code Playground
by the wazz
HTML
<div class="container">
<h2>lorem ipsum dolor sit amet</h2>
<h3>Some other stuff</h3>
<div class="box-container">
<div class="box">1</div>
<div class="box">2</div>
<div class="box">3</div>
<div class="box">4</div>
<div class="box">5</div>
<div class="box">6</div>
<div class="box">7</div>
<div class="box">8</div>
<div class="box">9</div>
<div class="box">10</div>
</div>
<h5>Maybe a button here</h5>
</div>
CSS
* {
box-sizing: border-box;
}
html, body {
margin: 0;
height: 100%;
font-family: Arial, sans-serif;
}
.container {
height: 100vh;
width: 30%;
background-color: #f9f9f9;
padding: 20px 30px;
position: absolute;
right: 0;
}
.box-container {
display: flex;
justify-content: space-between;
flex-wrap: wrap;
height: 100%;
overflow-y: auto;
}
.box {
display: flex;
justify-content: center;
align-items: center;
height: 150px;
width: 49%;
background-color: #FFDAC7;
margin-bottom: 5px;
font-size: 32px;
}