diff --git a/api-generator/components/scrolltop.js b/api-generator/components/scrolltop.js
index 3c694f2a3..4f59e0804 100644
--- a/api-generator/components/scrolltop.js
+++ b/api-generator/components/scrolltop.js
@@ -14,7 +14,7 @@ const ScrollTopProps = [
{
name: 'icon',
type: 'string',
- default: 'pi pi-chevron-up',
+ default: 'undefined',
description: 'Icon to display.'
},
{
@@ -25,10 +25,18 @@ const ScrollTopProps = [
}
];
+const ScrollTopSlots = [
+ {
+ name: 'icon',
+ description: 'Custom scrolltop icon template.'
+ }
+];
+
module.exports = {
scrolltop: {
name: 'ScrollTop',
description: 'ScrollTop gets displayed after a certain scroll position and used to navigates to the top of the page quickly.',
- props: ScrollTopProps
+ props: ScrollTopProps,
+ slots: ScrollTopSlots
}
};
diff --git a/components/lib/scrolltop/ScrollTop.d.ts b/components/lib/scrolltop/ScrollTop.d.ts
index 0cebe8d90..a6e6595ad 100644
--- a/components/lib/scrolltop/ScrollTop.d.ts
+++ b/components/lib/scrolltop/ScrollTop.d.ts
@@ -7,6 +7,7 @@
* @module scrolltop
*
*/
+import { VNode } from 'vue';
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
/**
@@ -25,7 +26,6 @@ export interface ScrollTopProps {
threshold?: number | undefined;
/**
* Icon to display.
- * @defaultValue pi pi-chevron-up
*/
icon?: string | undefined;
/**
@@ -38,7 +38,12 @@ export interface ScrollTopProps {
/**
* Defines valid slots in ScrollTop component.
*/
-export interface ScrollTopSlots {}
+export interface ScrollTopSlots {
+ /**
+ * Custom scrolltop icon template.
+ */
+ icon(): VNode[];
+}
/**
* Defines valid emits in ScrollTop component.
diff --git a/components/lib/scrolltop/ScrollTop.vue b/components/lib/scrolltop/ScrollTop.vue
index 59b6e2df4..63a150771 100644
--- a/components/lib/scrolltop/ScrollTop.vue
+++ b/components/lib/scrolltop/ScrollTop.vue
@@ -1,14 +1,16 @@