JSFiddle - React, Tailwind, and code Playground

HTML

<script src="https://github.com/niklasvh/html2canvas/releases/download/0.4.1/html2canvas.js"></script>
<div id="test"></div>

CSS

#test {
    top:100px;
    left:100px;
    position:absolute;
    background:#fc0;
    width: 180px;
    height: 50px;
    border-radius: 50px;
}

JavaScript

html2canvas(document.getElementById("test"), {
    onrendered: function (canvas) {
        document.body.appendChild(canvas);
    }
});