Features
- Integrated Search: Built-in search form with multiple layouts (inline, light, query filter)
- Request Handling: Automatic data fetching with pagination, sorting, and filtering
- Column Management: Dynamic column show/hide with drag-and-drop reordering
- Batch Operations: Multi-row selection with batch action support
- Editable Rows: Inline editing with validation
- Export & Print: Built-in data export and printing capabilities
- State Persistence: Automatic URL state sync and local storage
Basic Usage
Search Form
ProTable integrates a search form that automatically generates from column configuration:Search Layouts
- Query Filter
- Light Filter
- Disabled
Search Configuration
Request Handling
Therequest function handles data fetching with automatic integration of pagination, sorting, and filtering:
ActionRef
UseactionRef to control table behavior programmatically:
Column Types
ProTable supports rich value types for automatic rendering:Editable Table
Enable inline editing with the editable configuration:Drag Sort Table
Enable row reordering with drag and drop:Toolbar & Actions
Row Selection
Key Props
| Prop | Type | Description |
|---|---|---|
columns | ProColumns[] | Column configuration |
request | (params, sort, filter) => Promise<RequestData> | Data fetching function |
dataSource | T[] | Static data source |
actionRef | React.MutableRefObject<ActionType> | Action reference |
search | false | SearchConfig | Search form configuration |
toolBarRender | () => React.ReactNode[] | Toolbar buttons |
options | OptionsConfig | Table options (reload, settings, etc) |
rowKey | string | (row) => string | Row key field |
pagination | false | PaginationConfig | Pagination config |
editable | RowEditableConfig | Editable configuration |
ProTable extends Ant Design Table, so all Ant Design Table props are also supported.
Best Practices
Use columnKey for complex dataIndex
Use columnKey for complex dataIndex
When
dataIndex is an array path like ['user', 'name'], provide a unique key for search and filters to work correctly.Debounce search inputs
Debounce search inputs
Use
search.debounceTime to prevent excessive requests:Optimize large datasets
Optimize large datasets
For large datasets, enable virtual scrolling:
Persist table state
Persist table state
Use
manualRequest={false} and URL params for state persistence across page refreshes.Related Components
- EditableProTable - Inline editing
- DragSortTable - Drag and drop sorting
- ProList - List view alternative
- ProDescriptions - Detail view