FabricJS has the following API methods that change the z-index of objects:
canvas.sendBackwards(myObject) canvas.sendToBack(myObject) canvas.bringForward(myObject) canvas.bringToFront(myObject)
You can also use:
fabric.Canvas.prototype.orderObjects = function(compare) { this._objects.sort(compare); this.renderAll(); }