0

Is there any way to change style for < lightning-input> in LWC (not Aura)?

all I want is change the border radius and color. I could have used slds input for styling then I have to write all kind of custom validation myself.

inputField.setCustomValidity("some custom validation error");
inputField.reportValidity();

This simply works in lightning-input

1
0

You could also override the style using something like this

style="border:solid red; border-radius: 2%;"
1
  • When you inspect lightning-input you'll see there are parent elements to the input tag. Styling only gets applied to outer element
    – Arindam
    Jul 9 at 3:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.