Input Phone
Deprecated as of API version 47.0. We recommend migrating to Lightning Web Components and using the lightning-input component.
Descriptor
ui:inputPhoneTargets
Lightning Experience, Experience Builder Sites, Salesforce Mobile App, Lightning Out / Visualforce, Standalone Lightning App
Example Options
Using ui:inputPhoneThis example retrieves the value of a ui:inputPhone component and displays it using ui:outputPhone. To apply Lightning Design System styling, we recommend that you use lightning:input with type="tel" instead of ui:inputPhone. Similarly, we recommend using lightning:formattedPhone instead of ui:outputPhone.
Using ui:inputPhone
Code
<aura:component> <ui:inputPhone aura:id="phone" label="Phone Number" class="field" value="415-123-4567" /> <ui:button class="btn" label="Submit" press="{!c.setOutput}"/> <div aura:id="msg" class="hide"> You entered: <ui:outputPhone aura:id="oPhone" value="" /> </div> </aura:component>