Howto change the color in the checkbox when it is checked?
When my checkbox is checked, it has this color:
But i want to change to red.
How i can do that?
<input
type="checkbox"
disabled={isDisabled}
defaultChecked={checked}
onChange={() => setChecked(!checked)}
/>
CodePudding user response:
You can use accent-color
css property:
input[type='checkbox'] {
accent-color: red;
}
<input type="checkbox" />
Keep the browser support in mind when using this.