JSFiddle - React, Tailwind, and code Playground
HTML
<div class="menu"><span class="active">Первое меню</span><span>Второе меню</span></div>
CSS
.menu span {
background-color: white;
padding: .5em;
margin: .5em;
border: dashed 1px gray;
}
.menu span.active {
background-color: yellow;
}
JavaScript
$('.menu span').on('click', function(){
$(this).addClass('active')
.siblings().removeClass('active')
})