Is it possible to remove the label on lightning:namespace components?

I would like to use the lightning:input component in a data table.
Therefore my question is:
Is it possible to remove the label attribute on the lightning component?

<lightning:input type="number" label=" " name="aNumberInputField" />

is quite not the solution for this (shifted… doesn’t look good), and removing the attribute throws an error.
Any advise?


Yes you can set the variant attribute to "label-hidden", so your code should look like:

<lightning:input type="number" label="number" variant = "label-hidden" name="aNumberInputField"/>

Source : Link , Question Author : loeachim , Answer Author : Adrian Larson

Leave a Comment