JSFiddle - React, Tailwind, and code Playground
HTML
<div style="background:grey;display:inline-block;">
<canvas id="samplecanvas" style="background:red;"></canvas>
</div>
JavaScript
var c = document.getElementById("samplecanvas");
var ctx = c.getContext("2d");
ctx.font = "30px Arial";
ctx.fillText(" Hello World" ,10, 35);
ctx.fillText("This is Programing" ,10, 70);