JSFiddle - React, Tailwind, and code Playground
HTML
<div class="metric good">
</div>
<p>This is magical because the box can change widths and the arrow is always there, centered, and on top.</p>
CSS
body {
text-align: center;
padding-top: 50px;
}
.metric {
display: inline-block;
position: relative;
height: 150px;
width: 50%;
background: #69c;
overflow: hidden;
}
.metric:after {
position: absolute;
top: 0;
left: 50%;
margin-left: -250px;
content: '';
background: white;
width: 500px;
height: 0;
border: 250px solid white;
border-top: none;
border-bottom: 50px solid #69c;
box-sizing: border-box;
}