Overview

The List page component — usage and core props.

Usage

Here is a minimal example to display a list of users with a <DataTable>:

// in src/users.jsx
import { DataTable, List } from "@/components/admin";
 
export const UserList = () => (
  <List>
    <DataTable>
      <DataTable.Col source="id" />
      <DataTable.Col source="name" />
      <DataTable.Col source="username" />
      <DataTable.Col source="email" />
      <DataTable.Col source="address.street" />
      <DataTable.Col source="phone" />
      <DataTable.Col source="website" />
      <DataTable.Col source="company.name" />
    </DataTable>
  </List>
);
 
// in src/App.jsx
import { Admin } from "@/components/admin";
import { Resource } from "ra-core";
import jsonServerProvider from "ra-data-json-server";
 
import { UserList } from "./users";
 
const App = () => (
  <Admin
    dataProvider={jsonServerProvider("https://jsonplaceholder.typicode.com")}
  >
    <Resource name="users" list={UserList} />
  </Admin>
);
 
export default App;

That's enough to display a basic list with sorting and pagination.

You can find more advanced examples of <List> usage in the demo.

Props

PropRequiredTypeDefaultDescription
childrenOptional*ReactNode-Component(s) that display the records (e.g. <DataTable>)
renderOptional*(ctx) => ReactNode-Alternate render function receiving the list context
actionsOptionalReactNodedefault action barCustom actions area (right side of header)
asideOptionalReactNode-Side panel rendered alongside the list content
componentOptionalElementType"div"Override the root element wrapping the list content
emptyOptionalReactNode | false<Empty />Replacement for the default empty-state component
debounceOptionalnumber500Debounce (ms) for filter & sort changes
disableAuthenticationOptionalbooleanfalseSkip auth check for this page
disableBreadcrumbOptionalbooleanfalseSet to true to define a custom breadcrumb for the page, instead of the default one
disableSyncWithLocationOptionalbooleanfalseKeep list params local (not in the URL)
exporterOptionalfalse | (records, fetchRelated, dataProvider) => void-Custom export logic (set false to hide Export button)
filtersOptionalReactElement[]-Array of filter input elements (displayed inline)
filterOptionalobject-Permanent filters always applied
filterDefaultValuesOptionalobject-Initial filter form values
paginationOptionalReactNode<ListPagination />Custom pagination component
perPageOptionalnumber10Records per page
queryOptionsOptionalobject-Extra TanStack Query options
resourceOptionalstringinferredResource name, defaults to the current <ResourceContext>
sortOptional{ field: string; order: 'ASC' | 'DESC' }-Initial sort
storeKeyOptionalstring | falsederivedStorage key for persisted params; false disables persistence
titleOptionalstring | ReactNode | falseresource plural labelPage title

* Provide either children or render.

These props will soon be supported: emptyWhileLoading.

empty

When the list has no records and no active filters, <List> renders the default <Empty> component. Pass a custom node to replace it, or false to suppress it entirely:

import { List, DataTable } from "@/components/admin";
 
export const PostList = () => (
  <List
    empty={
      <p className="text-center py-8 text-muted-foreground">
        No posts yet. Create your first one!
      </p>
    }
  >
    <DataTable>
      <DataTable.Col source="id" />
      <DataTable.Col source="title" />
    </DataTable>
  </List>
);

component

By default, <List> wraps the list content in a <div>. Pass any React element type to component to replace it:

import { List, DataTable } from "@/components/admin";
import { Card } from "@/components/ui/card";
 
export const PostList = () => (
  <List component={Card}>
    <DataTable>
      <DataTable.Col source="id" />
      <DataTable.Col source="title" />
    </DataTable>
  </List>
);

aside

Pass any React node as aside to display a side panel next to the list. The aside floats to the right in a flex row alongside the list content:

import { List, DataTable } from "@/components/admin";
 
const ListHelp = () => (
  <div className="p-4 bg-muted rounded text-sm w-64">
    <p className="font-medium mb-2">Tips</p>
    <p>Use the filters above to narrow your search.</p>
  </div>
);
 
export const PostList = () => (
  <List aside={<ListHelp />}>
    <DataTable>
      <DataTable.Col source="id" />
      <DataTable.Col source="title" />
    </DataTable>
  </List>
);