Auto-generates a list page with columns generated based on the provided query document fields.
Example
Parameters
Readonly<ListPageProps<T, U, V, AC>>Props to configure the ListPage component.
stringA unique identifier for the list page. This is important to support customization functionality that relies on page IDs and makes your component extensible.
AnyRoute | (() => AnyRoute)Route object, which will be defined in the component file.string | React.ReactElementTThis DocumentNode of the list query, i.e. a query that fetches PaginatedList data with "items" and "totalItems", such as:
Example
TypedDocumentNode<any, { id: string }>Providing the deleteMutation will automatically add a "delete" menu item to the
actions column dropdown. Note that if this table already has a "delete" bulk action,
you don't need to additionally provide a delete mutation, because the bulk action
will be added to the action column dropdown already.
(variables: V) => VThis prop can be used to intercept and transform the list query variables before they are sent to the Admin API.
This allows you to implement specific logic that differs from the standard filter/sort handling.
Example
(searchTerm: string) => NonNullable<V['options']>['filter']Allows you to customize how the search term is used in the list query options. For instance, when you want the term to filter on specific fields.
Example
CustomizeColumnConfig<T>Allows you to customize the rendering and other aspects of individual columns.
By default, an appropriate component will be chosen to render the column data based on the data type of the field. However, in many cases you want to have more control over how the column data is rendered.
Example
ACAllows you to define extra columns that are not related to actual fields returned in the query result.
For example, in the Administrator list, we define an additional "name" column composed
of the firstName and lastName fields.
Example
(keyof ListQueryFields<T> | keyof AC | CustomFieldKeysOfItem<ListQueryFields<T>>)[]Allows you to specify the default order of columns in the table. When not defined, the order of fields in the list query document will be used.
SortingStateAllows you to specify the default sorting applied to the table.
Example
Partial< Record<keyof ListQueryFields<T> | keyof AC | CustomFieldKeysOfItem<ListQueryFields<T>>, boolean> >Allows you to specify the default columns that are visible in the table.
If you set them to true, then only those will show by default. If you set them to false,
then all other columns will be visible by default.
Example
React.ReactNodeFacetedFilterConfig<T>Allows you to define pre-set filters based on an array of possible selections
Example
RowAction<ListQueryFields<T>>[]Allows you to specify additional "actions" that will be made available in the "actions" column.
By default, the actions column includes all bulk actions defined in the bulkActions prop.
(data: any[]) => any[]Allows the returned list query data to be transformed in some way. This is an advanced feature that is not often required.
(table: TableOptions<any>) => TableOptions<any>Allows you to directly manipulate the TanStack Table TableOptions object before the
table is created. And advanced option that is not often required.
BulkActionsInputBulk actions are actions that can be applied to one or more table rows, and include things like
See the BulkAction docs for an example of how to build the component.
Example
PaginatedListRefresherRegisterFnRegister a function that allows you to assign a refresh function for this list. The function can be assigned to a ref and then called when the list needs to be refreshed.
(oldIndex: number, newIndex: number, item: any) => void | Promise<void>Callback when items are reordered via drag and drop. Only applies to top-level items. When provided, enables drag-and-drop functionality.
booleanWhen true, drag and drop will be disabled. This will only have an effect if the onReorder prop is also set Useful when filtering or searching.
Defaults to false. Only relevant when onReorder is provided.