diff --git a/components/locale-provider/__tests__/__snapshots__/index.test.js.snap b/components/locale-provider/__tests__/__snapshots__/index.test.js.snap
index d6bee74941..6e4e5582e9 100644
--- a/components/locale-provider/__tests__/__snapshots__/index.test.js.snap
+++ b/components/locale-provider/__tests__/__snapshots__/index.test.js.snap
@@ -5761,7 +5761,7 @@ exports[`Locale Provider should display the text as ar 1`] = `
type="button"
>
@@ -10358,7 +10358,7 @@ exports[`Locale Provider should display the text as bg 1`] = `
type="button"
>
@@ -14955,7 +14955,7 @@ exports[`Locale Provider should display the text as ca 1`] = `
type="button"
>
@@ -19552,7 +19552,7 @@ exports[`Locale Provider should display the text as cs 1`] = `
type="button"
>
@@ -24149,7 +24149,7 @@ exports[`Locale Provider should display the text as de 1`] = `
type="button"
>
@@ -28746,7 +28746,7 @@ exports[`Locale Provider should display the text as el 1`] = `
type="button"
>
@@ -33343,7 +33343,7 @@ exports[`Locale Provider should display the text as en 1`] = `
type="button"
>
@@ -37940,7 +37940,7 @@ exports[`Locale Provider should display the text as en-gb 1`] = `
type="button"
>
@@ -42537,7 +42537,7 @@ exports[`Locale Provider should display the text as es 1`] = `
type="button"
>
@@ -47134,7 +47134,7 @@ exports[`Locale Provider should display the text as et 1`] = `
type="button"
>
@@ -51731,7 +51731,7 @@ exports[`Locale Provider should display the text as fa 1`] = `
type="button"
>
@@ -56328,7 +56328,7 @@ exports[`Locale Provider should display the text as fi 1`] = `
type="button"
>
@@ -60925,7 +60925,7 @@ exports[`Locale Provider should display the text as fr 1`] = `
type="button"
>
@@ -65522,7 +65522,7 @@ exports[`Locale Provider should display the text as fr 2`] = `
type="button"
>
@@ -70119,7 +70119,7 @@ exports[`Locale Provider should display the text as is 1`] = `
type="button"
>
@@ -74716,7 +74716,7 @@ exports[`Locale Provider should display the text as it 1`] = `
type="button"
>
@@ -79313,7 +79313,7 @@ exports[`Locale Provider should display the text as ja 1`] = `
type="button"
>
@@ -83910,7 +83910,7 @@ exports[`Locale Provider should display the text as ko 1`] = `
type="button"
>
@@ -88507,7 +88507,7 @@ exports[`Locale Provider should display the text as ku-iq 1`] = `
type="button"
>
@@ -93104,7 +93104,7 @@ exports[`Locale Provider should display the text as nb 1`] = `
type="button"
>
@@ -97701,7 +97701,7 @@ exports[`Locale Provider should display the text as nl 1`] = `
type="button"
>
@@ -102298,7 +102298,7 @@ exports[`Locale Provider should display the text as nl-be 1`] = `
type="button"
>
@@ -106895,7 +106895,7 @@ exports[`Locale Provider should display the text as pl 1`] = `
type="button"
>
@@ -111492,7 +111492,7 @@ exports[`Locale Provider should display the text as pt 1`] = `
type="button"
>
@@ -116089,7 +116089,7 @@ exports[`Locale Provider should display the text as pt-br 1`] = `
type="button"
>
@@ -120686,7 +120686,7 @@ exports[`Locale Provider should display the text as ru 1`] = `
type="button"
>
@@ -125283,7 +125283,7 @@ exports[`Locale Provider should display the text as sk 1`] = `
type="button"
>
@@ -129880,7 +129880,7 @@ exports[`Locale Provider should display the text as sl 1`] = `
type="button"
>
@@ -134477,7 +134477,7 @@ exports[`Locale Provider should display the text as sr 1`] = `
type="button"
>
@@ -139074,7 +139074,7 @@ exports[`Locale Provider should display the text as sv 1`] = `
type="button"
>
@@ -143671,7 +143671,7 @@ exports[`Locale Provider should display the text as th 1`] = `
type="button"
>
@@ -148268,7 +148268,7 @@ exports[`Locale Provider should display the text as tr 1`] = `
type="button"
>
@@ -152865,7 +152865,7 @@ exports[`Locale Provider should display the text as uk 1`] = `
type="button"
>
@@ -157462,7 +157462,7 @@ exports[`Locale Provider should display the text as vi 1`] = `
type="button"
>
@@ -162059,7 +162059,7 @@ exports[`Locale Provider should display the text as zh-cn 1`] = `
type="button"
>
@@ -166656,7 +166656,7 @@ exports[`Locale Provider should display the text as zh-tw 1`] = `
type="button"
>
diff --git a/components/popconfirm/__tests__/__snapshots__/demo.test.js.snap b/components/popconfirm/__tests__/__snapshots__/demo.test.js.snap
index f1ad8b92a3..d84426db52 100644
--- a/components/popconfirm/__tests__/__snapshots__/demo.test.js.snap
+++ b/components/popconfirm/__tests__/__snapshots__/demo.test.js.snap
@@ -29,6 +29,14 @@ exports[`renders ./components/popconfirm/demo/dynamic-trigger.md correctly 1`] =
`;
+exports[`renders ./components/popconfirm/demo/icon.md correctly 1`] = `
+
+ Delete
+
+`;
+
exports[`renders ./components/popconfirm/demo/locale.md correctly 1`] = `
{
expect(cancel).toHaveBeenCalled();
expect(onVisibleChange).toHaveBeenLastCalledWith(false);
});
+
+ it('should support customize icon', () => {
+ const wrapper = mount(
+ custom-icon}>
+ show me your code
+
+ );
+
+ const triggerNode = wrapper.find('span').at(0);
+ triggerNode.simulate('click');
+ expect(wrapper.find('.customize-icon').length).toBe(1);
+ });
});
diff --git a/components/popconfirm/demo/icon.md b/components/popconfirm/demo/icon.md
new file mode 100644
index 0000000000..cc54ebbc0f
--- /dev/null
+++ b/components/popconfirm/demo/icon.md
@@ -0,0 +1,24 @@
+---
+order: 4
+title:
+ zh-CN: 自定义 Icon 图标
+ en-US: Customize icon
+---
+
+## zh-CN
+
+使用 `icon` 自定义提示 `icon`。
+
+## en-US
+
+Set `icon` props to customize the icon.
+
+````jsx
+import { Popconfirm, Icon } from 'antd';
+
+ReactDOM.render(
+ }>
+ Delete
+ ,
+ mountNode);
+````
diff --git a/components/popconfirm/index.en-US.md b/components/popconfirm/index.en-US.md
index 4b3116203d..2e7a5ef517 100644
--- a/components/popconfirm/index.en-US.md
+++ b/components/popconfirm/index.en-US.md
@@ -22,6 +22,7 @@ The difference with the `confirm` modal dialog is that it's more lightweight tha
| title | title of the confirmation box | string\|ReactNode | - |
| onCancel | callback of cancel | function(e) | - |
| onConfirm | callback of confirmation | function(e) | - |
+| icon | customize icon of confirmation | ReactNode | <Icon type="exclamation-circle" /> |
Consult [Tooltip's documentation](https://ant.design/components/tooltip/#API) to find more APIs.
diff --git a/components/popconfirm/index.tsx b/components/popconfirm/index.tsx
index 119733fa8a..04ab2a6f24 100644
--- a/components/popconfirm/index.tsx
+++ b/components/popconfirm/index.tsx
@@ -13,6 +13,7 @@ export interface PopconfirmProps extends AbstractTooltipProps {
okText?: React.ReactNode;
okType?: ButtonType;
cancelText?: React.ReactNode;
+ icon?: React.ReactNode;
}
export interface PopconfirmState {
@@ -31,6 +32,7 @@ export default class Popconfirm extends React.Component,
};
private tooltip: any;
@@ -92,12 +94,12 @@ export default class Popconfirm extends React.Component {
- const { prefixCls, title, cancelText, okText, okType } = this.props;
+ const { prefixCls, title, cancelText, okText, okType, icon } = this.props;
return (