Displays a formatted name that can include a salutation and suffix.
For Use In
Lightning Experience, Experience Builder Sites, Salesforce Mobile App, Lightning Out (Beta), Standalone Lightning App, Mobile Offline
A lightning-formatted-name component shows formatted names in a given
format and order. The locale you set in the app’s user preferences determines how
the component formats the names and how it presents the order of the names.
This example specifies “Mr. John Middleton Doe The 3rd Jo” based on the
default English United States locale with the long format.
The format attribute determines the length of the name.
Format
Description
Example
short
Shows the first name and last name only.
John Doe
medium
Shows the first name, middle name, and last name only.
John Middleton Doe
long (default)
Shows the name including salutation, first name, middle name, last name, suffix, informal name.
Mr. John Middleton Doe The 3rd Jo
For more information on supported locales, see
Supported Locales
in the Salesforce Help.
To create a form that takes in user input for names, you can use the
lightning-input-name component, which shows a name compound field that
supports user input for salutation, suffix, and so on.
Use the Locale Information
In Lightning Experience, the locale value corresponds to the Locale field on the Language & Time Zone page in the user’s personal settings.
By default, the org’s locale setting determines the order of the name fields. If a user sets their personal locale setting, it overrides the org’s locale setting.
For example, if you select “French (France)” in the Locale field, lightning-formatted-name uses fr-FR as the locale.