In my current project, I am utilizing react styled components for styling. One issue that I have encountered is with the text placement within a box and the need to style it differently when checked.
What have I attempted so far?
I created an outer div and placed a radio input inside it with a display:none property. My intention was to style the outer element while keeping the radio button hidden. However, this approach rendered the radio button unclickable. Is there a solution to this problem? A react-specific solution would be highly appreciated.
.radio__input{
display:none;
}
.radiobox{
width:60px;
height:60px;
border:1px solid black;
}
//I want the div radiobox to be styled when one radiobox is selected
<div class="radiobox">
<input type="radio" class="radio__input" name="radio"/>
XS
</div>
<div class="radiobox">
<input type="radio" class="radio__input" name="radio"/>
S
</div>