New and Changed Lightning Components

Build user interfaces quickly with a bevy of new components.

New Components

The following components are new and require API version 43.0 and later.

lightning:insertImageButton
Adds an insert image button to the toolbar of the lightning:inputRichText rich text editor. The button opens the native file browser so that you can select an image to upload and inserts the image inline in the text area. You can use this component only as a subcomponent within the lightning:inputRichText component.A rich text editor with the insert image button
lightning:navigation
Generates a URL for the given pageReference object, which describes a page’s type, attributes, and state. For more information, see New Lightning Navigation APIs for Lightning Components.
lightning:navigationItemAPI
Provides access to methods for programmatically controlling navigation items in Lightning console apps in which navigation items display in an item menu. This component provides access to the following Lightning Console JavaScript API methods:
  • focusNavigationItem()
  • getNavigationItems()
  • getSelectedNavigationItem()
  • refreshNavigationItem()
Note

Note

This component provides similar functionality to some of the Salesforce Console Integration Toolkit JavaScript APIs available in Salesforce Classic.

For more information, see Salesforce Console API.

lightning:nextBestActions (Pilot)
Executes a recommendation strategy, and displays the resulting propositions. Each proposition launches a screen flow. For more information, see Einstein Next Best Action: Use Strategies to Recommend Actions and Offers (Pilot).
Note

Note

We provide Einstein Next Best Action to selected customers through a pilot program that requires agreement to specific terms and conditions. To be nominated to participate in the program, contact Salesforce. Pilot programs are subject to change, and we can’t guarantee acceptance. Einstein Next Best Action isn’t generally available unless or until Salesforce announces its general availability in documentation or in press releases or public statements. We can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features. You can provide feedback and suggestions for Einstein Next Best Action in the IdeaExchange.

lightning:quickActionAPI
Provides access to methods for interacting with the quick actions on a Lightning page. Use this component to call the Lightning Quick Action JavaScript APIs. This component provides similar functionality to the Salesforce Classic Publisher JavaScript APIs. For more information, see Lightning Quick Action and Salesforce Classic Publisher JavaScript APIs.
lightning:recordForm
Streamlines creating a form to add, view, or update a record. This component makes it easier to create record forms than building them manually with lightning:recordEditForm and lightning:recordViewForm. Set the mode attribute to view, edit, or readonly to specify the type of form. This form was created by specifying mode=”edit” to add a record.The ligtning:recordForm for adding a record
lightningsnapin:minimizedAPI
Enables customization of the user interface for the minimized snap-in in Snap-ins Chat.
lightningsnapin:settingsAPI
Enables access to the Live Agent button ID and Live Agent deployment ID for use in the custom pre-chat and minimized components for Snap-ins Chat.

Components Now Generally Available

The following components which were beta in previous releases are now generally available:

  • lightning:comboBox
  • lightning:fileUpload
  • lightning:formattedDateTime
  • lightning:formattedNumber
  • lightning:input
  • lightning:relativeDateTime

Changed Components

The following components have changed.

lightning:container
This component now checks that its namespace matches its static resource’s namespace. The component also generates a confirmation token to ensure that raw <iframe> elements aren’t used. For more information, see Lightning Container Components Have New Security Enhancements.
lightning:datatable
This component now supports mass inline editing, so you can edit content in multiple table cells and save the changes in one step. The component verifies that you want to update multiple items before it applies your changes.

Columns now support horizontal alignment with the cellAttributes property.

The following attributes are new.
  • errors—Specifies an object containing information about cell-level, row-level, and table-level errors. Error messages are displayed in the table accordingly.
  • oncellchange—The action triggered when a cell’s value changes after an inline edit. Returns the draftValues object.
  • oncancel—The action triggered when clicking Cancel in the table footer during an inline edit.
  • onsave—The action triggered when clicking Save in the table footer during an inline edit. Returns the draftValues object.
The following column property is new.
  • editable—Specifies whether a column supports inline editing. The default is false.
The following values for the type column property are new.
  • boolean—Displays a checkbox in the column of a Boolean data type.
  • date-local—Displays a date field only, not a date and time field.
The following attribute for the cellAttributes column property is new.
  • alignment—Specifies where to align data horizontally in a column. Allowed values are center, right, or left.
lightning:flow

The onstatuschange attribute returns activeStages and currentStage. These additional parameters, which were beta in Spring ’18, are now generally available.

lightning:icon

You can now use your own custom icons in addition to the icons at https://lightningdesignsystem.com/icons. Use the new src attribute to specify the path to the resource for a custom icon such as an SVG sprite. For example, you could specify:

src="path/to/customSvgSprite.svg#my-icon"
lightning:input
The following types now implement Lightning Design System styling.
  • color
  • date
  • datetime
  • time

The datetime input type supports a new timezone attribute, which enables you to specify a time zone that’s different from your Salesforce time zone setting.

The date, datetime, and time types now format the date based on the user's locale setting in Salesforce. Prior to the Summer ‘18 release, the component formatted based on the user's browser locale. On mobile devices, the component uses the native date and time pickers as before, but on desktop the component uses the Lightning date and time pickers.

lightning:inputAddress
The following attribute is new.
  • fieldLevelHelp—Help text detailing the purpose and function of the address compound field.
lightning:inputName
The following attribute is new.
  • fieldLevelHelp—Help text detailing the purpose and function of the name compound field.
lightning:inputRichText
This component now supports pasting inline images that you copied from a browser window into the text editor. In Chrome and Safari on macOS, you can also paste inline images copied from the desktop.

On all platforms, you can use the new lightning:insertImageButton as a child component. This component adds a button to the editor’s toolbar to enable uploading an image from the desktop.

The following attributes are new.
  • label—Text label for the rich text editor.
  • labelVisible—Specifies whether the label is visible or detected only by screen readers. The default is false.
lightning:tree
The following attribute is new.
  • metatext—Text to provide users with supplemental information and aid with identification or disambiguation.
lightning:utilityBarAPI
This component has a new method.
  • onUtilityClick()—Registers an event handler for the utility. This event handler is called when the utility is clicked.
For more information, see Salesforce Console API.
lightning:workspaceAPI
This component has new methods.
  • refreshTab()—Refreshes a workspace tab or a subtab specified by tabId. Keep in mind that the first subtab has the same tabId as the workspace tab.
  • disableTabClose()—Prevents a workspace tab or subtab from closing. This method removes the close button from a tab or subtab, and disables the keyboard shortcuts that close tabs and subtabs.
For more information, see Salesforce Console API.