Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

List View

The List View is where users interact with a list of Collection Documents within the Admin Panel. This is where they can view, sort, filter, and paginate their documents to find exactly what they're looking for. This is also where users can perform bulk operations on multiple documents at once, such as deleting, editing, or publishing many.

The List View can be swapped out in its entirety for a Custom View, or it can be injected with a number of Custom Components to add additional functionality or presentational elements without replacing the entire view.

Custom List View

To swap out the entire List View with a Custom View, use the admin.components.views.list property in your Collection Config:

1
import type { CollectionConfig } from 'payload'
2
3
export const MyCollection: CollectionConfig = {
4
// ...
5
admin: {
6
components: {
7
views: {
8
list: {
9
Component: '/path/to/MyCustomListView',
10
},
11
},
12
},
13
},
14
}

Here is an example of a custom List View:

Server Component

1
import React from 'react'
2
import type { ListViewServerProps } from 'payload'
3
4
export function MyCustomServerListView(props: ListViewServerProps) {
5
return <div>This is a custom List View (Server)</div>
6
}

Client Component

1
'use client'
2
import React from 'react'
3
import type { ListViewClientProps } from 'payload'
4
5
export function MyCustomClientListView(props: ListViewClientProps) {
6
return <div>This is a custom List View (Client)</div>
7
}

Props

Custom List Views receive a different set of props than other views because Payload pre-fetches data and pre-renders components before passing the results to your component. The exact props available depend on whether you are building a Server or Client Component.

Server Component Props (ListViewServerProps)

Server components receive all client props plus the following additional server-only data:

Prop

Description

collectionConfig

The sanitized Collection Config for this collection.

data

The paginated query result, including docs, totalDocs, page, totalPages, etc.

limit

The number of documents displayed per page.

listPreferences

Saved user preferences for this list (columns, sort, etc.).

listSearchableFields

The fields configured as searchable in the collection's admin options.

i18n

The i18n object.

locale

The active locale, if localization is enabled.

params

Route parameters from the Next.js dynamic route.

payload

The Payload class.

permissions

The current user's permissions.

searchParams

URL search parameters (page, sort, where, limit, etc.).

user

The currently authenticated user.

Client Component Props (ListViewClientProps)

Prop

Description

collectionSlug

The slug of the collection being displayed.

columnState

An array of column definitions describing the current table columns and their state.

disableBulkDelete

When true, hides the bulk delete action.

disableBulkEdit

When true, hides the bulk edit action.

disableQueryPresets

When true, disables the query presets feature.

enableRowSelections

When true, enables checkboxes on each row for bulk actions.

hasCreatePermission

Whether the current user has permission to create new documents.

hasDeletePermission

Whether the current user has permission to delete documents.

hasTrashPermission

Whether the current user has permission to use the trash.

newDocumentURL

The URL to navigate to when creating a new document.

renderedFilters

A Map<string, React.ReactNode> of pre-rendered filter components, keyed by field path.

resolvedFilterOptions

A Map<string, ResolvedFilterOptions> of resolved options for relationship filter fields.

viewType

The current view type identifier.

Table

A pre-rendered React node of the documents table. Pass this through to render the built-in table.

AfterList

Slot for components rendered after the list.

AfterListTable

Slot for components rendered after the table.

BeforeList

Slot for components rendered before the list.

BeforeListTable

Slot for components rendered before the table.

Description

Slot for the collection description component.

listMenuItems

Slot for custom items rendered in the list controls menu.

Using DefaultListView

If you want to keep Payload's built-in table and controls but add your own layout around them, import and render DefaultListView from @payloadcms/ui:

1
'use client'
2
import React from 'react'
3
import type { ListViewClientProps } from 'payload'
4
import { DefaultListView } from '@payloadcms/ui'
5
6
export function MyCustomClientListView(props: ListViewClientProps) {
7
return (
8
<div>
9
<h1>My Custom Header</h1>
10
<DefaultListView {...props} />
11
</div>
12
)
13
}

Custom Components

In addition to swapping out the entire List View with a Custom View, you can also override individual components. This allows you to customize specific parts of the List View without swapping out the entire view for your own.

To override List View components for a Collection, use the admin.components property in your Collection Config:

Slot Props

All slot components (beforeList, beforeListTable, afterList, afterListTable) receive the same base set of client props plus additional server-only props in Server Components:

Client Props (BeforeListClientProps, AfterListClientProps, etc.):

Prop

Description

collectionSlug

The slug of the collection being displayed.

hasCreatePermission

Whether the current user has permission to create new documents.

hasDeletePermission

Whether the current user has permission to delete documents.

hasTrashPermission

Whether the current user has permission to use the trash.

newDocumentURL

The URL to navigate to when creating a new document.

Additional Server-Only Props (BeforeListServerProps, AfterListServerProps, etc.):

Prop

Description

collectionConfig

The sanitized Collection Config for this collection.

data

The paginated query result, including docs, totalDocs, page, totalPages, etc.

limit

The number of documents displayed per page.

listPreferences

Saved user preferences for this list (columns, sort, etc.).

listSearchableFields

The fields configured as searchable in the collection's admin options.

i18n

The i18n object.

payload

The Payload class.

permissions

The current user's permissions.

user

The currently authenticated user.

1
import type { CollectionConfig } from 'payload'
2
3
export const MyCollection: CollectionConfig = {
4
// ...
5
admin: {
6
components: {
7
// ...
8
},
9
},
10
}

The following options are available:

Path

Description

beforeList

An array of custom components to inject before the list of documents in the List View. More details.

beforeListTable

An array of custom components to inject before the table of documents in the List View. More details.

afterList

An array of custom components to inject after the list of documents in the List View. More details.

afterListTable

An array of custom components to inject after the table of documents in the List View. More details.

listMenuItems

An array of components to render within a menu next to the List Controls (after the Columns and Filters options)

Description

A component to render a description of the Collection. More details.

beforeList

The beforeList property allows you to inject custom components before the list of documents in the List View.

To add beforeList components, use the components.beforeList property in your Collection Config:

1
import type { CollectionConfig } from 'payload'
2
3
export const MyCollection: CollectionConfig = {
4
// ...
5
admin: {
6
components: {
7
beforeList: ['/path/to/MyBeforeListComponent'],
8
},
9
},
10
}

Here's an example of a custom beforeList component:

Server Component

1
import React from 'react'
2
import type { BeforeListServerProps } from 'payload'
3
4
export function MyBeforeListComponent(props: BeforeListServerProps) {
5
return <div>This is a custom beforeList component (Server)</div>
6
}

Client Component

1
'use client'
2
import React from 'react'
3
import type { BeforeListClientProps } from 'payload'
4
5
export function MyBeforeListComponent(props: BeforeListClientProps) {
6
return <div>This is a custom beforeList component (Client)</div>
7
}

beforeListTable

The beforeListTable property allows you to inject custom components before the table of documents in the List View.

To add beforeListTable components, use the components.beforeListTable property in your Collection Config:

1
import type { CollectionConfig } from 'payload'
2
3
export const MyCollection: CollectionConfig = {
4
// ...
5
admin: {
6
components: {
7
beforeListTable: ['/path/to/MyBeforeListTableComponent'],
8
},
9
},
10
}

Here's an example of a custom beforeListTable component:

Server Component

1
import React from 'react'
2
import type { BeforeListTableServerProps } from 'payload'
3
4
export function MyBeforeListTableComponent(props: BeforeListTableServerProps) {
5
return <div>This is a custom beforeListTable component (Server)</div>
6
}

Client Component

1
'use client'
2
import React from 'react'
3
import type { BeforeListTableClientProps } from 'payload'
4
5
export function MyBeforeListTableComponent(props: BeforeListTableClientProps) {
6
return <div>This is a custom beforeListTable component (Client)</div>
7
}

afterList

The afterList property allows you to inject custom components after the list of documents in the List View.

To add afterList components, use the components.afterList property in your Collection Config:

1
import type { CollectionConfig } from 'payload'
2
3
export const MyCollection: CollectionConfig = {
4
// ...
5
admin: {
6
components: {
7
afterList: ['/path/to/MyAfterListComponent'],
8
},
9
},
10
}

Here's an example of a custom afterList component:

Server Component

1
import React from 'react'
2
import type { AfterListServerProps } from 'payload'
3
4
export function MyAfterListComponent(props: AfterListServerProps) {
5
return <div>This is a custom afterList component (Server)</div>
6
}

Client Component

1
'use client'
2
import React from 'react'
3
import type { AfterListClientProps } from 'payload'
4
5
export function MyAfterListComponent(props: AfterListClientProps) {
6
return <div>This is a custom afterList component (Client)</div>
7
}

afterListTable

The afterListTable property allows you to inject custom components after the table of documents in the List View.

To add afterListTable components, use the components.afterListTable property in your Collection Config:

1
import type { CollectionConfig } from 'payload'
2
3
export const MyCollection: CollectionConfig = {
4
// ...
5
admin: {
6
components: {
7
afterListTable: ['/path/to/MyAfterListTableComponent'],
8
},
9
},
10
}

Here's an example of a custom afterListTable component:

Server Component

1
import React from 'react'
2
import type { AfterListTableServerProps } from 'payload'
3
4
export function MyAfterListTableComponent(props: AfterListTableServerProps) {
5
return <div>This is a custom afterListTable component (Server)</div>
6
}

Client Component

1
'use client'
2
import React from 'react'
3
import type { AfterListTableClientProps } from 'payload'
4
5
export function MyAfterListTableComponent(props: AfterListTableClientProps) {
6
return <div>This is a custom afterListTable component (Client)</div>
7
}

Description

The Description property allows you to render a custom description of the Collection in the List View.

To add a Description component, use the components.Description property in your Collection Config:

1
import type { CollectionConfig } from 'payload'
2
3
export const MyCollection: CollectionConfig = {
4
// ...
5
admin: {
6
components: {
7
Description: '/path/to/MyDescriptionComponent',
8
},
9
},
10
}

Here's an example of a custom Description component:

Server Component

1
import React from 'react'
2
import type { ViewDescriptionServerProps } from 'payload'
3
4
export function MyDescriptionComponent(props: ViewDescriptionServerProps) {
5
return <div>This is a custom Collection description component (Server)</div>
6
}

Client Component

1
'use client'
2
import React from 'react'
3
import type { ViewDescriptionClientProps } from 'payload'
4
5
export function MyDescriptionComponent(props: ViewDescriptionClientProps) {
6
return <div>This is a custom Collection description component (Client)</div>
7
}

Was this page helpful?

Next

Authentication Overview