JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://rawgit.com/kangax/fabric.js/master/dist/fabric.js"></script>
<canvas id="c" width="600" height="600"></canvas>
CSS
canvas {
border: 1px solid #999;
}
JavaScript
/**
* fabric.js template for bug reports
*
* Please update the name of the jsfiddle (see Fiddle Options).
* This templates uses latest dev verison of fabric.js (https://rawgithub.com/kangax/fabric.js/master/dist/fabric.js).
*/
// initialize fabric canvas and assign to global windows object for debug
var canvas = window._canvas = new fabric.Canvas('c');
//fabric.Object.prototype.objectCaching = false;
// ADD YOUR CODE HERE
var textSample = new fabric.IText("Something \n Helloooo\n not cool", {
left: 50,
top: 50,
fontSize: 24,
lineHeight: 0.7,
shadow:{'blur':2,'color':'red','offsetX':-20,'offsetY':-20}
});
canvas.add(textSample)