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" />
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.
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.
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. |