Output URL (Deprecated)

ui:outputUrl

Deprecated as of API version 47.0. We recommend migrating to Lightning Web Components and using the lightning-formatted-url 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-url.

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

Usage Overview (Deprecated) 

A ui:outputURL component represents a URL that is wrapped in an HTML a tag. We recommend using lightning:formattedUrl instead of ui:outputURL.

ui:outputURL can be used with ui:inputURL, which takes in a URL input. To apply Lightning Design System styling, we recommend that you use lightning:input with type="url" instead of ui:inputURL.

To display a URL, you can use an attribute value and bind it to the ui:outputURL component.

1<aura:attribute name="myURL" type="String" default="http://www.google.com" />
2
3<ui:outputURL value="{!v.myURL}" label="Search" />

The previous example renders the following HTML.

1<a href="http://www.google.com" class="uiOutputURL">Search</a>

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
altThe alternate text description for image (used when there is no label)String
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
disabledSpecifies whether the component should be displayed in a disabled state. Default value is "false".Booleanfalse
iconClassThe CSS style used to display the icon or image.String
labelThe text displayed on the component.String
targetThe target destination where this rendered component is displayed. Possible values: _blank, _parent, _self, _topString
titleThe text to display as a tooltip when the mouse pointer hovers over this component.String
valueThe URL of the page that the link goes to.String