JSFiddle - React, Tailwind, and code Playground

by Julien Etienne

HTML

<div>
  
</div>

CSS

div {
  width: 400px;
  aspect-ratio: 1 / 1.1547005;
  background: lime;
  clip-path: polygon(0% 25%, 0% 75%, 50% 100%, 100% 75%, 100% 25%, 50% 0%);
}

JavaScript

// And some more complex polygons!
// http://kizu.github.com/Polygons/
// Fork them on github: https://github.com/kizu/Polygons/