Skip to main content

List Page: Search and Data Table

  • Use List to wrap list views and pass filters to support search.
  • Use DataTable with DataTable.Col to render columns.
src/customers/CustomersList.tsx
import { DataTable, List, SearchInput } from "@/components/admin";

const filters = [
<SearchInput key="q" source="name_ilike" alwaysOn label={false} />,
];

export const CustomersList = () => (
<List filters={filters}>
<DataTable rowClick="edit" bulkActionButtons={false}>
<DataTable.Col source="id" />
<DataTable.Col source="name" />
<DataTable.Col source="age" />
<DataTable.Col source="email" />
<DataTable.Col source="created_at" />
</DataTable>
</List>
);
  • Note: in the example, name_ilike is used for fuzzy matching by name. Adjust parameters to match your data service query API.