There are lot of solutions out there to hide the input spinner using css. One of them being:
input::-webkit-inner-spin-button, input::-webkit-outer-spin-button {
-webkit-appearance: none !important;
margin: 0 !important;
-moz-appearance:textfield !important;
}
I want to know how I can implement it in styled-component? Thanks
Declare like this:
const Input = styled.input`
::-webkit-inner-spin-button{
-webkit-appearance: none;
margin: 0;
}
::-webkit-outer-spin-button{
-webkit-appearance: none;
margin: 0;
}
`;
Use like this:
<Input type="number">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With