JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://cdnjs.cloudflare.com/ajax/libs/pixi.js/5.3.0/pixi.min.js"></script>
JavaScript
const app = new PIXI.Application({
width:300,
height:200
});
app.stage.sortableChildren=true;
document.body.appendChild(app.view);
var g1 = new PIXI.Graphics();
g1.beginFill(0xee2233);
g1.drawRect(0, 0, 50, 60);
g1.endFill();
g1.x=10;
g1.y=20;
g1.zIndex=1;
g1.interactive=true;
g1.buttonMode=true;
g1.on('pointertap', e => alert('red'));
app.stage.addChild(g1);
var g2 = new PIXI.Graphics();
g2.beginFill(0x1122ff);
g2.drawRect(0, 0, 50, 60);
g2.endFill();
g2.x=20;
g2.y=30;
g2.zIndex=2;
app.stage.addChild(g2);