Home > Software engineering >  How to style radio input button (ReactJS)?
How to style radio input button (ReactJS)?

Time:03-27

Would like to change the color of radio button:

enter image description here

However, it seems not working, still getting the default color:

enter image description here

CodePudding user response:

You can't change the radio button color directly, You need to build your own and customize it as you want.

or you can use filter with hue-rotate() but it's not supported on Internet Explorer have a look here for more info

Edit There is a better way to do this as @Servesh Chaturvedi mentioned using accent-color: red;

#one{
  filter: hue-rotate(150deg);
}

#two{
  accent-color:red;
}
 <input type="radio" id="one" name="radio" value="first">
<label for="html">First</label><br>

 <input type="radio" id="two" name="radio" value="second">
<label for="html">Second</label><br>
 

  • Related