JSFiddle - React, Tailwind, and code Playground

JavaScript

$(document).keydown(function(e) {
    switch (e.which) {
    case 37:
        if (e.shiftKey) {
            alert('shift+left'); // shift and left arrow key
        }
        else {
            alert('left'); //left arrow key
        }
        break;
    case 38:
        alert('top'); //up arrow key
        break;
    }
});