Result
Used to feedback the processing results of a series of operations.
When To Use
Use when important operations need to inform the user to process the results and the feedback is more complicated.
Examples
- Success ·
success - Info ·
info - Warning ·
warning - 403 ·
403 - 404 ·
404 - 500 ·
500 - Error ·
error - Custom icon ·
customIcon - Custom semantic dom styling ·
style-class
API
Common props ref:Common props
| Property | Description | Type | Default | Version | Global Config |
|---|---|---|---|---|---|
| classNames | Customize class for each semantic structure inside the component. Supports object or function | Record<SemanticDOM, string> | (info: { props }) => Record<SemanticDOM, string> | - | 6.0.0 | 6.0.0 |
| extra | Operating area | ReactNode | - | × | |
| icon | Custom back icon | ReactNode | - | × | |
| status | Result status, decide icons and colors | success | error | info | warning | 404 | 403 | 500 | info | × | |
| styles | Customize inline style for each semantic structure inside the component. Supports object or function | Record<SemanticDOM, CSSProperties> | (info: { props }) => Record<SemanticDOM, CSSProperties> | - | 6.0.0 | 6.0.0 |
| subTitle | The subTitle | ReactNode | - | × | |
| title | The title | ReactNode | - | × |
Semantic DOM
| Semantic node | Native description | Version |
|---|---|---|
root | Root element with text alignment, layout styles and other basic container styles | 6.0.0 |
icon | Icon element with margin, text alignment, font size, status colors and other icon styles | 6.0.0 |
title | Title element with font size, text color, line height, text alignment and other text styles | 6.0.0 |
subTitle | Subtitle element with font size, text color, line height and other text styles | 6.0.0 |
extra | Action area element with margin, text alignment, inner element spacing and other layout styles | 6.0.0 |
body | Content element with margin, padding, background color and other content area styles | 6.0.0 |
Semantic description source: vendor/components/result/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 |
|---|---|---|
titleFontSize | number | string | Title font size |
subtitleFontSize | number | Subtitle font size |
iconFontSize | number | string | Icon size |
extraMargin | CSSProperties['margin'] | Margin of extra area |
Declaration source: vendor/components/result/style/index.ts
import type { CSSProperties } from 'react';
import type { CSSObject } from '@ant-design/cssinjs';
import { unit } from '@ant-design/cssinjs';
import { isNumber } from '../../_util/is';
import type { FullToken, GenerateStyle, GetDefaultToken } from '../../theme/internal';
import { genStyleHooks, mergeToken } from '../../theme/internal';
export interface ComponentToken {
/**
* @desc 标题字体大小
* @descEN Title font size
*/
titleFontSize: number | string;
/**
* @desc 副标题字体大小
* @descEN Subtitle font size
*/
subtitleFontSize: number;
/**
* @desc 图标大小
* @descEN Icon size
*/
iconFontSize: number | string;
/**
* @desc 额外区域外间距
* @descEN Margin of extra area
*/
extraMargin: CSSProperties['margin'];
}
interface ResultToken extends FullToken<'Result'> {
imageWidth: number | string;
imageHeight: number | string;
resultInfoIconColor: string;
resultSuccessIconColor: string;
resultWarningIconColor: string;
resultErrorIconColor: string;
}
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/result/index.tsxvendor/components/result/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.