Well, if someone still want to know the answer in 2023. For antd v5, you would add prefixCls prop in the Checkbox component like this
<Checkbox prefixCls="show-error" ...other props> {`ShowError`} </Checkbox>
Then in your CSS file, you would add
.show-error-wrapper-checked > .show-error > .show-error-inner { background-color: #ff4d4f !important; border-color: #ff4d4f !important; } .show-error-wrapper > .show-error:hover > .show-error-inner { border-color: #ff4d4f !important; }
Importantly, don't forget to add !important in your code, and that won't be any caveats of adding it here, since the class name is unique.
<Checkbox/>and it will return my checkbox with my CSS<input type="checkbox"/>)