JSFiddle - React, Tailwind, and code Playground

HTML

<div class="box">
    
<div class='a'></div>
</div>
<div class="box">
<div class='b'></div>
    </div>

CSS

.box {
width:100px;
    height:100px;
    margin-right:20px;
    float:left;
}
.a {
    width: 80px;
    height: 80px;
    padding: 10px;
    border: 0px solid yellow;
    background-color: red;
    display: inline-block
}

.b {
    width: 80px;
    height: 80px;
     padding: 10px;
    background-color: blue;
    display: inline-block;
 
}

JavaScript

$('.a').mouseenter(function(){
    $(this).animate({
        'padding': 0,
        'borderWidth': 10
    });
}).mouseleave(function(){
    $(this).animate({
        'padding': 10,
        'borderWidth': 0
    });
});