Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.
Input Component Labels
This example shows how to use labels using the label attribute on an input component.
1<lightning:input type="number" name="myNumber" label="Pick a Number:" value="54" />The label is placed on the left of the input field and can be hidden by setting variant="label-hidden", which applies the slds-assistive-text class to the label to support accessibility.
Using $Label
Use the $Label global value provider to access labels stored in an external source. For example:
1<lightning:input type="number" name="myNumber" label="{!$Label.Number.PickOne}" />1{!format($Label.np.labelName, v.name)}