Features
- Automatic Rendering: Rich value types with automatic formatting
- Request Integration: Load data asynchronously
- Inline Editing: Edit fields directly in the descriptions view
- Column Configuration: ProTable-compatible column definitions
- Copy Support: Built-in copy-to-clipboard
- Responsive Layout: Automatic layout adjustment
Basic Usage
Using Columns
Define descriptions using column configuration:Request Integration
Load data asynchronously:Value Types
ProDescriptions supports all ProField value types:Inline Editing
Enable inline editing for fields:Edit Trigger
Click the edit icon to enter edit mode:Copy Support
Ellipsis
Span & Layout
Responsive Columns
Action Buttons
Add action buttons to the descriptions:Custom Render
Array DataIndex
Access nested data:Empty Text
Customize empty value display:ActionRef
Key Props
| Prop | Type | Description |
|---|---|---|
columns | ProDescriptionsItemProps[] | Column configuration |
dataSource | Record<string, any> | Data source |
request | (params) => Promise<RequestData> | Async data fetching |
params | Record<string, any> | Request params |
editable | RowEditableConfig | Editable configuration |
onDataSourceChange | (data) => void | Data source change handler |
actionRef | React.MutableRefObject<ActionType> | Action reference |
column | number | ResponsiveColumn | Number of columns |
title | ReactNode | Title |
tooltip | string | LabelTooltipType | Tooltip |
emptyText | ReactNode | Empty value placeholder |
loading | boolean | Loading state |
ProDescriptions.Item Props
| Prop | Type | Description |
|---|---|---|
label | ReactNode | Field label |
dataIndex | string | string[] | Data field key |
valueType | ProFieldValueType | Value type |
valueEnum | ValueEnum | Value enum mapping |
render | (text, record, index) => ReactNode | Custom render |
copyable | boolean | { text: string } | Enable copy |
ellipsis | boolean | { showTitle: boolean } | Enable ellipsis |
span | number | Column span |
editable | boolean | function | Enable editing |
Best Practices
Use appropriate value types
Use appropriate value types
Choose the correct valueType for automatic formatting:
- Use
moneyfor currency - Use
percentfor percentages - Use
dateTimefor timestamps - Use
progressfor completion status
Enable copyable for IDs and keys
Enable copyable for IDs and keys
Make it easy for users to copy important identifiers:
Use ellipsis for long text
Use ellipsis for long text
Prevent layout issues with long content:
Organize with column span
Organize with column span
Use span to control visual hierarchy: