JSFiddle - React, Tailwind, and code Playground

HTML

<canvas id="example1" width="400" height="300"></canvas>

JavaScript

// get the canvas
var canvas = document.getElementById('example1');

// get the "2d" context
var context = canvas.getContext('2d');

// change fill style to orange
context.fillStyle = '#ff7700';

// draw an orange rectangle
context.fillRect(0, 0, 300, 300);