A lightning:formattedAddress component displays formatted addresses in a given format and order. The locale set in the app's user preferences determines how addresses are formatted and the order they are presented. A valid address that includes the street, city, country, province, and postal code must be used.
This example displays an address.
<aura:component> <lightning:formattedAddress street="1 Market St." city="San Francisco" country="US" province="CA" postalCode="94105" /> </aura:component>
The output looks like this. By default, the address is displayed as a link, which when clicked takes you to the given location on Google Maps.
1 Market St.
San Francisco, CA 94105
US
If the latitude and longitude are provided, the address is displayed as the link label, and the link directs you to the given location provided by the latitude and longitude on Google Maps.
Attribute Name | Attribute Type | Description | Required? |
---|---|---|---|
body | Component[] | The body of the component. In markup, this is everything in the body of the tag. | |
city | String | The city detail for the address. | |
class | String | A CSS class for the outer element, in addition to the component's base classes. | |
country | String | The country detail for the address. | |
disabled | Boolean | Specifies whether the address is clickable. This value defaults to false. | |
latitude | Decimal | The latitude of the location if known. Latitude values must be within -90 and 90. | |
longitude | Decimal | The longitude of the location if known. Longitude values must be within -180 and 180. | |
postalCode | String | The postal code detail for the address. | |
province | String | The province detail for the address. | |
street | String | The street detail for the address. | |
title | String | Displays tooltip text when the mouse moves over the element. |