2019-05-22 23:22:09 +08:00
---
category: Components
2022-11-09 12:28:04 +08:00
group: Data Display
2019-12-18 12:09:05 +08:00
title: Descriptions
2024-03-22 14:22:42 +08:00
description: Display multiple read-only fields in a group.
2022-11-30 20:14:41 +08:00
cover: https://mdn.alipayobjects.com/huamei_7uahnr/afts/img/A*fHdlTpif6XQAAAAAAAAAAAAADrJ8AQ/original
2023-02-09 22:17:31 +08:00
coverDark: https://mdn.alipayobjects.com/huamei_7uahnr/afts/img/A*d27AQJrowGAAAAAAAAAAAAAADrJ8AQ/original
2019-05-22 23:22:09 +08:00
---
## When To Use
Commonly displayed on the details page.
2023-07-17 14:48:03 +08:00
```tsx | pure
// works when >= 5.8.0, recommended ✅
const items: DescriptionsProps['items'] = [
{
key: '1',
label: 'UserName',
children: < p > Zhou Maomao< / p > ,
},
{
key: '2',
label: 'Telephone',
children: < p > 1810000000< / p > ,
},
{
key: '3',
label: 'Live',
children: < p > Hangzhou, Zhejiang< / p > ,
},
{
key: '4',
label: 'Remark',
children: < p > empty< / p > ,
},
{
key: '5',
label: 'Address',
children: < p > No. 18, Wantang Road, Xihu District, Hangzhou, Zhejiang, China< / p > ,
},
];
< Descriptions title = "User Info" items = {items} / > ;
// works when < 5.8.0 , deprecated when > =5.8.0 🙅🏻♀️
< Descriptions title = "User Info" >
< Descriptions.Item label = "UserName" > Zhou Maomao< / Descriptions.Item >
< Descriptions.Item label = "Telephone" > 1810000000< / Descriptions.Item >
< Descriptions.Item label = "Live" > Hangzhou, Zhejiang< / Descriptions.Item >
< Descriptions.Item label = "Remark" > empty< / Descriptions.Item >
< Descriptions.Item label = "Address" >
No. 18, Wantang Road, Xihu District, Hangzhou, Zhejiang, China
< / Descriptions.Item >
< / Descriptions > ;
```
2022-11-09 12:28:04 +08:00
## Examples
2022-11-17 17:31:26 +08:00
<!-- prettier - ignore -->
2022-11-09 12:28:04 +08:00
< code src = "./demo/basic.tsx" > Basic< / code >
< code src = "./demo/border.tsx" > border< / code >
< code src = "./demo/text.tsx" debug > border< / code >
< code src = "./demo/size.tsx" > Custom size< / code >
< code src = "./demo/responsive.tsx" > responsive< / code >
< code src = "./demo/vertical.tsx" > Vertical< / code >
< code src = "./demo/vertical-border.tsx" > Vertical border< / code >
< code src = "./demo/style.tsx" debug > Customize label & wrapper style< / code >
2023-07-17 14:48:03 +08:00
< code src = "./demo/jsx.tsx" debug > JSX demo< / code >
2023-05-17 14:22:48 +08:00
< code src = "./demo/component-token.tsx" debug > Component Token< / code >
2022-11-09 12:28:04 +08:00
2019-05-22 23:22:09 +08:00
## API
2023-08-08 18:27:48 +08:00
Common props ref: [Common props](/docs/react/common-props)
2019-05-22 23:22:09 +08:00
### Descriptions
2019-07-11 14:14:33 +08:00
| Property | Description | Type | Default | Version |
| --- | --- | --- | --- | --- |
2020-07-01 22:37:55 +08:00
| bordered | Whether to display the border | boolean | false | |
2020-10-21 10:33:43 +08:00
| colon | Change default props `colon` value of Descriptions.Item | boolean | true | |
2023-07-06 09:44:11 +08:00
| column | The number of `DescriptionItems` in a row,could be a number or a object like `{ xs: 8, sm: 16, md: 24}` ,(Only set `bordered={true}` to take effect) | number \| [Record<Breakpoint, number> ](https://github.com/ant-design/ant-design/blob/84ca0d23ae52e4f0940f20b0e22eabe743f90dca/components/descriptions/index.tsx#L111C21-L111C56 ) | 3 | |
2021-08-10 15:38:25 +08:00
| contentStyle | Customize content style | CSSProperties | - | 4.10.0 |
2020-10-21 10:33:43 +08:00
| extra | The action area of the description list, placed at the top-right | ReactNode | - | 4.5.0 |
2023-07-17 14:48:03 +08:00
| items | Describe the contents of the list item | [DescriptionsItem ](#descriptionitem )[] | - | 5.8.0 |
2020-12-30 17:08:43 +08:00
| labelStyle | Customize label style | CSSProperties | - | 4.10.0 |
2020-01-17 17:23:48 +08:00
| layout | Define description layout | `horizontal` \| `vertical` | `horizontal` | |
2020-10-21 10:33:43 +08:00
| size | Set the size of the list. Can be set to `middle` ,`small`, or not filled | `default` \| `middle` \| `small` | - | |
| title | The title of the description list, placed at the top | ReactNode | - | |
2019-05-22 23:22:09 +08:00
### DescriptionItem
2023-08-30 22:09:32 +08:00
| Property | Description | Type | Default | Version |
| --- | --- | --- | --- | --- |
| contentStyle | Customize content style | CSSProperties | - | 4.9.0 |
| label | The description of the content | ReactNode | - | |
| labelStyle | Customize label style | CSSProperties | - | 4.9.0 |
| span | The number of columns included | number \| [Screens ](/components/grid#col ) | 1 | `screens: 5.9.0` |
2020-12-24 12:02:57 +08:00
> The number of span Description.Item. Span={2} takes up the width of two DescriptionItems. When both `style` and `labelStyle`(or `contentStyle`) configured, both of them will work. And next one will overwrite first when conflict.
2023-04-11 10:25:24 +08:00
## Design Token
< ComponentTokenTable component = "Descriptions" > < / ComponentTokenTable >