JSFiddle - React, Tailwind, and code Playground
HTML
<label>
<input type="radio" name="toppings" value="green peppers"/>
Green Peppers
</label>
<label>
<input type="radio" name="toppings" value="onions"/>
Onions
</label>
<label>
<input type="radio" name="toppings" value="pepperoni"/>
Pepperoni
</label>
CSS
label.selected {
background: white;
border-left: 1px solid #000;
}
JavaScript
$(document).ready(function() {
$('input[type=radio]').change(function(){
$('label').removeClass('selected');
$(this).parents('label').addClass('selected');
});
});