diff --git a/api-generator/components/button.js b/api-generator/components/button.js
index 359c3d45e..cc17ea7d3 100644
--- a/api-generator/components/button.js
+++ b/api-generator/components/button.js
@@ -97,10 +97,25 @@ const ButtonProps = [
}
];
+const ButtonEvents = [];
+
+const ButtonSlots = [
+ {
+ name: 'icon',
+ description: 'Custom icon template.'
+ },
+ {
+ name: 'loadingicon',
+ description: 'Custom loading icon template.'
+ }
+];
+
module.exports = {
button: {
name: 'Button',
description: 'Button is an extension to standard button element with icons and theming.',
- props: ButtonProps
+ props: ButtonProps,
+ events: ButtonEvents,
+ slots: ButtonSlots
}
};
diff --git a/components/lib/button/Button.d.ts b/components/lib/button/Button.d.ts
index a66e2a8d8..7d85f2b53 100755
--- a/components/lib/button/Button.d.ts
+++ b/components/lib/button/Button.d.ts
@@ -54,7 +54,6 @@ export interface ButtonProps extends ButtonHTMLAttributes {
loading?: boolean | undefined;
/**
* Icon to display in loading state.
- * @defaultValue pi pi-spinner pi-spin
*/
loadingIcon?: string | undefined;
/**
@@ -105,6 +104,26 @@ export interface ButtonSlots {
* Custom content such as icons, images and text can be placed inside the button via the default slot. Note that when slot is used, label, icon and badge properties are not included.
*/
default(): VNode[];
+ /**
+ * Custom icon template.
+ * @param {Object} scope - icon slot's params.
+ */
+ icon(scope: {
+ /**
+ * Style class of the icon.
+ */
+ class: string;
+ }): VNode[];
+ /**
+ * Custom loading icon template.
+ * @param {Object} scope - loading icon slot's params.
+ */
+ loadingicon(scope: {
+ /**
+ * Style class of the loading icon.
+ */
+ class: string;
+ }): VNode[];
}
/**
diff --git a/components/lib/button/Button.vue b/components/lib/button/Button.vue
index a60cececc..ce787ef81 100755
--- a/components/lib/button/Button.vue
+++ b/components/lib/button/Button.vue
@@ -1,15 +1,21 @@