Output Phone (Deprecated)

ui:outputPhone

Deprecated as of API version 47.0. We recommend migrating to Lightning Web Components and using the lightning-formatted-phone component.

For Use In

Lightning Experience, Experience Builder Sites, Salesforce Mobile App, Lightning Out (Beta), Standalone Lightning App

Deprecation Guidelines 

We recommend using Lightning Web Components whenever possible. When migrating to Lightning Web Components, use lightning-formatted-phone.

For more information, see Aura Components in the ui Namespace Are Deprecated.

Usage Overview (Deprecated) 

A ui:outputPhone component represents a phone number output that is wrapped in an HTML span tag. We recommend using lightning:formattedPhone instead of ui:outputPhone.

ui:outputPhone can be used with ui:inputPhone, which takes in a phone number input. To apply Lightning Design System styling, we recommend that you use lightning:input with type="tel" instead of ui:inputPhone.

The following example is a simple set up of a ui:outputPhone component.

1<ui:outputPhone value="415-123-4567" />

The previous example renders the following HTML.

1<span class="uiOutputPhone">415-123-4567</span>

When viewed on a mobile device, the example renders as an actionable link.

1<span class="uiOutputPhone">
2  <a href="tel:415-123-4567">415-123-4567</a>
3</span>

To display record data for Salesforce objects, use lightning:outputField with lightning:recordViewForm, or use lightning:recordForm. To display record data with a custom layout, use force:recordData.

Note

Attributes 

NameDescriptionTypeDefaultRequired
bodyThe body of the component. In markup, this is everything in the body of the tag.Aura.Component[]
classA CSS style to be attached to the component. This style is added in addition to base styles output by the component.String
valueThe phone number displayed when this component is rendered.String