lightning:listView

Displays a List View of the specified object. This component requires API 42.0 and later.

A lightning:listView component represents a list view of records that you own or have read or write access to, and records shared with you. They also include records owned by or shared with users in roles below you in the role hierarchy. You can see only the fields that are visible according to your page layout and field-level security settings.

To create a list view, specify which object to render with the objectApiName attribute and which list view to use with the listName attribute. The list view doesn't require additional Apex controllers or Lightning Data Service to display record data.

This example displays a list view of Accounts with five rows. Each time "Load More" is clicked, five more rows are loaded and appended.

The action bar isn't shown at the top of the component and the per-row actions are also hidden. However, inline edit of individual cells is available.

<lightning:listView aura:id="listViewAccounts"
    objectApiName="Account"
    listName="My_Accounts"
    rows="5"
    showActionBar="false"
    enableInlineEdit="true"
    showRowLevelActions="false"
/>
        
Usage Considerations

Links outside of Lightning Experience and Communities appear as hyperlinks but don't navigate to the link target. This is a known limitation that will be addressed in a future release.

lightning:listView supports the following features:
  • Inline editing
  • Resizing and sorting of columns
  • Text wrapping
  • Loading of additional rows
You can configure inline editing. Other features aren't configurable. Additionally, the following features are not supported via the lightning:listView UI.
  • Creating or deleting of list views
  • Modifying of the list view filter
  • Switching to other list views
If an invalid objectApiName or listName value is used, an error displays. The following objects are supported:
  • Account
  • Asset
  • Campaign
  • Case
  • Contact
  • ContentVersion
  • Contract
  • Entitlement
  • EntityMilestone
  • EnvironmentHubMember
  • Lead
  • MaintenancePlan
  • OperatingHours
  • Opportunity
  • Order
  • Product2
  • Pricebook2
  • Quote
  • ResourcePreference
  • ReturnOrder
  • ServiceAppointment
  • ServiceResource
  • ServiceTerritory
  • ServiceTerritoryMember
  • ServiceResourceSkill
  • ServiceCrew
  • ServiceCrewMember
  • ServiceContract
  • Shipment
  • SkillRequirement
  • SocialPost
  • Tenant
  • TimeSheet
  • TimeSheetEntry
  • WorkType
  • WorkOrder
  • WorkOrderLineItem

Inline edit, row level actions, and the action bar are supported in Lightning Experience, the Salesforce app, and communities only.

If attempting to use these features outside of this context, they are automatically disabled and a warning displays.

On a desktop, this component renders a full list view. On all other form factors, such as a tablet or mobile devices, the component renders a mobile-friendly alternative.

Attributes

Attribute Name Attribute Type Description Required?
body Component[] The body of the component. In markup, this is everything in the body of the tag.
enableInlineEdit Boolean Specifies whether the inline edit of cells is enabled. This value defaults to false.
listName String The developer name of the List View Yes
objectApiName String The API name of the object to be displayed in this List View Yes
rows Integer Specifies the number of rows to initially load and additional rows after each subsequent 'Load More' click. The default and maximum number of rows value is 50.
showActionBar Boolean Specifies whether the action bar displays. This value defaults to false.
showRowLevelActions Boolean Specifies whether row level actions are displayed (as a dropdown menu in the last column of the row). This value defaults to false.