JSFiddle - React, Tailwind, and code Playground

by Melnikov_Sergey

HTML

<script src="https://github.com/0xfe/vexflow/blob/master/releases/vexflow-debug.js"></script>
<div id="boo"></div>

JavaScript

VF = Vex.Flow;

// Create an SVG renderer and attach it to the DIV element named "boo".
var div = document.getElementById("boo")
var renderer = new VF.Renderer(div, VF.Renderer.Backends.SVG);

// Configure the rendering context.
renderer.resize(500, 500);
var context = renderer.getContext();
context.setFont("Arial", 10, "").setBackgroundFillStyle("#eed");

// Create a stave of width 400 at position 10, 40 on the canvas.
var stave = new VF.Stave(10, 40, 400);

// Add a clef and time signature.
stave.addClef("treble").addTimeSignature("2/4");

// Connect it to the rendering context and draw!
stave.setContext(context).draw();