Skip to main content
Navigate to list views for any object. Optionally specify a filter name to display a specific list view.

Source

force-app/main/default/lwc/navToListView/navToListView.js

Usage

import { LightningElement } from 'lwc';
import { NavigationMixin } from 'lightning/navigation';

export default class NavToListView extends NavigationMixin(LightningElement) {
    navigateToList() {
        this[NavigationMixin.Navigate]({
            type: 'standard__objectPage',
            attributes: {
                objectApiName: 'Contact',
                actionName: 'list'
            },
            state: {
                filterName: 'Recent'
            }
        });
    }
}
Extend your component with NavigationMixin to access navigation capabilities:
export default class NavToListView extends NavigationMixin(LightningElement) {
    // component code
}

PageReference

type
string
required
Set to standard__objectPage for object pages
attributes.objectApiName
string
required
The API name of the object (e.g., ‘Contact’, ‘Account’, ‘Opportunity’)
attributes.actionName
string
required
Set to list to display the object’s list view
state.filterName
string
The API name of the list view to display (e.g., ‘Recent’, ‘AllContacts’, ‘MyContacts’). If omitted, displays the default list view for the object

List View Filters

Common filter names include:
  • Recent - Recently viewed records
  • AllContacts - All contacts (object-specific)
  • MyContacts - My contacts (object-specific)
  • Custom list view API names
You can find the API name of a list view in Setup or by querying the ListView object.

Key Features

  • Navigate to object list views
  • Specify custom list view filters
  • Supports all standard and custom objects
  • Type-safe navigation with PageReference

Build docs developers (and LLMs) love