Descriptions
Display multiple read-only fields in a group.
When To Use
Commonly displayed on the details page.
// 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>;
Examples
-
Basic ·
basic -
border ·
border -
Custom size ·
size -
responsive ·
responsive -
Vertical ·
vertical -
Vertical border ·
vertical-border -
Custom semantic dom styling ·
style-class -
row ·
block
API
Common props ref:Common props
Descriptions
| Property | Description | Type | Default | Version | Global Config |
|---|---|---|---|---|---|
| bordered | Whether to display the border | boolean | false | × | |
| classNames | Customize class for each semantic structure inside the component. Supports object or function. | Record<SemanticDOM, string> | (info: { props })=> Record<SemanticDOM, string> | - | 5.23.0 | |
| colon | Change default props colon value of Descriptions.Item. Indicates whether the colon after the label is displayed | boolean | true | × | |
| column | The number of DescriptionItems in a row, could be an object (like { xs: 8, sm: 16, md: 24}, but must have bordered={true}) or a number | number | Record<Breakpoint, number> | 3 | × | |
Customize content style, Please use styles.content instead | CSSProperties | - | 4.10.0 | × | |
| extra | The action area of the description list, placed at the top-right | ReactNode | - | 4.5.0 | × |
| items | Describe the contents of the list item | DescriptionsItem[] | - | 5.8.0 | × |
Customize label style, Please use styles.label instead | CSSProperties | - | 4.10.0 | × | |
| layout | Define description layout | horizontal | vertical | horizontal | × | |
| size | Set the size of the list. Can be set to medium,small, or not filled | large | medium | small | large | × | |
| styles | Customize inline style for each semantic structure inside the component. Supports object or function. | Record<SemanticDOM, CSSProperties> | (info: { props })=> Record<SemanticDOM, CSSProperties> | - | 5.23.0 | |
| title | The title of the description list, placed at the top | ReactNode | - | × |
DescriptionItem
| Property | Description | Type | Default | Version |
|---|---|---|---|---|
Customize content style, Please use styles.content instead | CSSProperties | - | 4.9.0 | |
| label | The description of the content | ReactNode | - | |
Customize label style, Please use styles.label instead | CSSProperties | - | 4.9.0 | |
| span | The number of columns included(filled Fill the remaining part of the current row) | number | filled | Screens | 1 | screens: 5.9.0, filled: 5.22.0 |
The number of span Description.Item. Span={2} takes up the width of two DescriptionItems. When both
styleandlabelStyle(orcontentStyle) configured, both of them will work. And next one will overwrite first when conflict.
Semantic DOM
| Semantic node | Native description | Version |
|---|---|---|
root | Root element with basic styles, reset styles, border styles, layout direction and other overall styles for description list container | 5.23.0 |
header | Header element with flex layout, alignment, bottom margin and other layout and style controls for header area | 5.23.0 |
title | Title element with text ellipsis, flex ratio, color, font weight, font size, line height and other title text styles | 5.23.0 |
extra | Extra content element with left margin, color, font size and other styles for additional operation area | 5.23.0 |
label | Label element with color, font weight, font size, line height, text align, colon styles and other label text styles | 5.23.0 |
content | Content element with table cell layout, color, font size, line height, word break and other content display styles | 5.23.0 |
Semantic description source: vendor/components/descriptions/demo/_semantic.tsx
Design Token
Types, inheritance and declarations retain the pinned native source. Defaults are computed by the native theme and may be overridden by ConfigProvider; this table does not invent static defaults.
| Token | Type | Native description |
|---|---|---|
labelBg | string | Background color of label |
labelColor | string | Text color of label |
titleColor | string | Text color of title |
titleMarginBottom | number | Bottom margin of title |
itemPaddingBottom | number | Bottom padding of item |
itemPaddingEnd | number | End padding of item |
colonMarginRight | number | Right margin of colon |
colonMarginLeft | number | Left margin of colon |
contentColor | string | Text color of content |
extraColor | string | Text color of extra area |
Declaration source: vendor/components/descriptions/style/index.ts
import { unit } from '@ant-design/cssinjs';
import type { CSSObject } from '@ant-design/cssinjs';
import { resetComponent, textEllipsis } from '../../style';
import type { FullToken, GenerateStyle, GetDefaultToken } from '../../theme/internal';
import { genStyleHooks, mergeToken } from '../../theme/internal';
/** Component only token. Which will handle additional calculation of alias token */
export interface ComponentToken {
// Component token here
/**
* @desc 标签背景色
* @descEN Background color of label
*/
labelBg: string;
/**
* @desc 标签文字颜色
* @descEN Text color of label
*/
labelColor: string;
/**
* @desc 标题文字颜色
* @descEN Text color of title
*/
titleColor: string;
/**
* @desc 标题下间距
* @descEN Bottom margin of title
*/
titleMarginBottom: number;
/**
* @desc 子项下间距
* @descEN Bottom padding of item
*/
itemPaddingBottom: number;
/**
* @desc 子项结束间距
* @descEN End padding of item
*/
itemPaddingEnd: number;
/**
* @desc 冒号右间距
* @descEN Right margin of colon
*/
colonMarginRight: number;
/**
* @desc 冒号左间距
* @descEN Left margin of colon
*/
colonMarginLeft: number;
/**
* @desc 内容区域文字颜色
* @descEN Text color of content
*/
contentColor: string;
/**
* @desc 额外区域文字颜色
* @descEN Text color of extra area
*/
extraColor: string;
}
interface DescriptionsToken extends FullToken<'Descriptions'> {}
Shared native props
Tips: The following generic properties apply to most antd components; those not supported are described separately.
| Property | Description | Type | Default |
|---|---|---|---|
| style | The additional style | CSSProperties | - |
| className | The additional css class | string | - |
| rootClassName | ClassName on the root element | string | - |
| autoFocus | Auto focus when component mounted, only effective for focusable elements like forms, links, etc. | boolean | false |
Install and reproduce an example
npm install antd@6.6.5 @ant-design/icons@6.3.4 dayjs@1.11.23
Use ConfigProvider and native App; configure dayjs locale separately. Each example lists its complete source files and additional pinned dependencies in View code. Example names select demos, not universal component props. See the resource setup guide for theme, locale and SSR.
Native type references
The source viewer includes unchanged native implementations and the following source declarations. Inherited types remain in their native packages. English source comments are preserved as code reference.
vendor/components/descriptions/Cell.tsxvendor/components/descriptions/DescriptionsContext.tsvendor/components/descriptions/Item.tsvendor/components/descriptions/Row.tsxvendor/components/descriptions/index.tsxvendor/components/descriptions/style/index.ts
Source and license
https://github.com/ant-design/ant-design/tree/4a39f54842eade4e565ab336ef6097cd7e723cdd
Original bilingual prose and executable examples are retained. Website-only embeds and token tables are expanded locally. Ant Design is MIT; separately listed dependency notices also apply. Upload previews block outbound requests and do not provide a backend.