Back to Ant Design

Result

components/result/index.zh-CN.md

6.3.71.7 KB
Original Source

何时使用 {#when-to-use}

当有重要操作需告知用户处理结果,且反馈内容较为复杂时使用。

代码演示 {#examples}

<!-- prettier-ignore -->

<code src="./demo/success.tsx">Success</code> <code src="./demo/info.tsx">Info</code> <code src="./demo/warning.tsx">Warning</code> <code src="./demo/403.tsx">403</code> <code src="./demo/404.tsx">404</code> <code src="./demo/500.tsx">500</code> <code src="./demo/error.tsx">Error</code> <code src="./demo/customIcon.tsx">自定义 icon</code> <code src="./demo/style-class.tsx" version="6.0.0">自定义语义结构的样式和类</code> <code src="./demo/component-token.tsx" debug>组件 Token</code>

API

通用属性参考:通用属性

参数说明类型默认值版本
classNames自定义组件内部各语义化结构的类名。支持对象或函数Record<SemanticDOM, string> | (info: { props }) => Record<SemanticDOM, string>-
extra操作区ReactNode-
icon自定义 iconReactNode-
status结果的状态,决定图标和颜色success | error | info | warning | 404 | 403 | 500info
styles自定义组件内部各语义化结构的内联样式。支持对象或函数Record<SemanticDOM, CSSProperties> | (info: { props }) => Record<SemanticDOM, CSSProperties>-
subTitlesubTitle 文字ReactNode-
titletitle 文字ReactNode-

Semantic DOM

<code src="./demo/_semantic.tsx" simplify="true"></code>

主题变量(Design Token){#design-token}

<ComponentTokenTable component="Result"></ComponentTokenTable>