I am using lightning:input for autocomplete (ui:inputText doesn't really work here correctly as it doesn't update value until you remove focus from field):

                      label=" "
                      placeholder="Opportunity or Project"

However, I do not like the whitespace left above the field. What is the right way to remove it? It's kind of annoying that its required in first place, esp. when we have alternatives like placeholder (I know I know, semantically it's not the same, but in some cases it makes sense to use placeholder).


unfortunately you cannot remove label from lightning:input. Its a required property.You can get around it by giving a space like you did.


Btw, if you remove label the component will go blank.

We had a similar issue(when we set label = " "),what we did was through CSS removed extra margin/padding to ensure blank space doesn't get added for input box.

|improve this answer|||||
  • Actually found my answer here: salesforce.stackexchange.com/questions/160897/… Not sure why I wasn't able to Google it out in first place. – dzh May 18 '17 at 2:31
  • No worries. At least from your comments future readers can take a look at that and help themselves. – RedDevil May 18 '17 at 3:02

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