Skip to main content

ProDescriptions API

ProDescriptions is an enhanced descriptions component that supports data fetching, editable fields, and automatic value type rendering.

ProDescriptionsProps

Extends Ant Design Descriptions props.
columns
ProDescriptionsItemProps[]
Column configuration for description items.
dataSource
T
Data object to display.
request
function
Fetch data from the server.
(params?: Record<string, any>) => Promise<{ data: T; success?: boolean }>
params
Record<string, any>
Parameters for the request. Changes trigger reload.
actionRef
React.MutableRefObject<ActionType>
Reference to control the descriptions programmatically.Methods:
  • reload() - Reload data
  • startEditable(key) - Start editing a field
  • cancelEditable(key) - Cancel editing a field
loading
boolean
Loading state.
onLoadingChange
function
Callback when loading state changes.
(loading?: boolean) => void
onRequestError
function
Callback when request fails.
(e: Error) => void
onDataSourceChange
function
Callback when data source changes (for editable mode).
(value: T) => void

Layout

title
React.ReactNode
Descriptions title.
tooltip
string | LabelTooltipType
Tooltip for the title.
extra
React.ReactNode
Extra content in the header.
column
number | Record<Breakpoint, number>
default:"3"
Number of columns.Can be responsive:
column={{ xs: 1, sm: 2, md: 3 }}
layout
'horizontal' | 'vertical'
default:"horizontal"
Layout orientation.
bordered
boolean
default:"false"
Whether to show border.
size
'default' | 'middle' | 'small'
default:"default"
Size of the descriptions.
colon
boolean
default:"true"
Whether to show colon after labels.
labelStyle
React.CSSProperties
Style for labels.
contentStyle
React.CSSProperties
Style for content.

Editable

editable
RowEditableConfig
Configuration for editable fields.
formProps
FormProps
Props for the form (when editable is enabled).
emptyText
React.ReactNode
default:"-"
Text to display when value is empty.

ProDescriptionsItemProps

Configuration for individual description items.
dataIndex
string | string[]
required
Data index to read from dataSource.
title
React.ReactNode | function
Item label.Can be a function:
(schema: ProSchema, type: string) => React.ReactNode
label
React.ReactNode
Alias for title (same as Ant Design Descriptions.Item).
tooltip
string | LabelTooltipType
Tooltip for the label.
valueType
ProFieldValueType
default:"text"
Type of the value for rendering.
valueEnum
Record<string, any>
Value enum for mapping values to display text.
render
function
Custom render for the value.
(text: any, record: T, index: number, action: ActionType, schema: ProSchema) => React.ReactNode
renderText
function
Transform the value before rendering.
(text: any, record: T, index: number, action: ActionType) => any
renderFormItem
function
Custom render for the form field (in edit mode).
fieldProps
any
Props passed to the field component.
formItemProps
FormItemProps
Props for the Form.Item wrapper.
request
function
Load remote data for select/cascader fields.
(params?: any) => Promise<{ label: React.ReactNode; value: any }[]>
params
any
Parameters for the request.
span
number | 'filled' | object
default:"1"
Number of columns to span.Can be responsive:
span={{ xs: 2, sm: 3, md: 4 }}
Use 'filled' to fill remaining space.
ellipsis
boolean | { showTitle?: boolean }
default:"false"
Whether to show ellipsis for long text.
copyable
boolean
default:"false"
Whether the value is copyable.
mode
'read' | 'edit'
Display mode for the field.
plain
boolean
default:"false"
Plain text mode (no label).
hide
boolean
default:"false"
Hide this item.
editable
boolean | function
default:"true"
Whether the field is editable.
boolean | ((text: any, record: T, index: number) => boolean)
order
number
Sort order (higher values appear first).
index
number
Index of the item.
className
string
CSS class name.
style
React.CSSProperties
Inline styles.
classNames
CellSemanticClassNames
Semantic class names.
type CellSemanticClassNames = {
  label?: string;
  content?: string;
}
styles
CellSemanticStyles
Semantic styles.
type CellSemanticStyles = {
  label?: React.CSSProperties;
  content?: React.CSSProperties;
}

ProDescriptions.Item

Alternative JSX syntax for defining description items.
<ProDescriptions>
  <ProDescriptions.Item label="Name" dataIndex="name" />
  <ProDescriptions.Item label="Age" dataIndex="age" valueType="digit" />
</ProDescriptions>

Usage Examples

import { ProDescriptions } from '@ant-design/pro-components';

export default () => (
  <ProDescriptions
    columns={[
      {
        title: 'Name',
        dataIndex: 'name',
      },
      {
        title: 'Email',
        dataIndex: 'email',
        copyable: true,
      },
      {
        title: 'Status',
        dataIndex: 'status',
        valueType: 'select',
        valueEnum: {
          active: { text: 'Active', status: 'Success' },
          inactive: { text: 'Inactive', status: 'Default' },
        },
      },
    ]}
    dataSource={{
      name: 'John Doe',
      email: '[email protected]',
      status: 'active',
    }}
  />
);

Build docs developers (and LLMs) love