diff --git a/docs/api-site-config.md b/docs/api-site-config.md
index 8f36a49377..b706c69a92 100644
--- a/docs/api-site-config.md
+++ b/docs/api-site-config.md
@@ -153,6 +153,10 @@ h1 {
`separateCss` - Folders inside which any `css` files will not be processed and concatenated to Docusaurus' styles. This is to support static `html` pages that may be separate from Docusaurus with completely separate styles.
+`scrollToTop` - Set this to `true` if you want to enable the scroll to top button at the bottom of your site.
+
+`scrollToTopOptions` - Optional options configuration for the scroll to top button. You do not need to use this, even if you set `scrollToTop` to `true`; it just provides you more configuration control of the button. You can find more options [here](https://github.com/vfeskov/vanilla-back-to-top/blob/v7.1.14/OPTIONS.md). By default, we set the zIndex option to 100.
+
`stylesheets` - Array of CSS sources to load. The link tag will be inserted in the HTML head.
`translationRecruitingLink` - URL for the `Help Translate` tab of language selection when languages besides English are enabled. This can be included you are using translations but does not have to be.
@@ -246,6 +250,10 @@ const siteConfig = {
twitterUsername: 'docusaurus',
twitterImage: 'img/docusaurus.png',
ogImage: 'img/docusaurus.png',
+ scrollToTop: true,
+ scrollToTopOptions: {
+ zIndex: 100
+ }
};
module.exports = siteConfig;
diff --git a/lib/core/Head.js b/lib/core/Head.js
index 04d68e080b..1334796bef 100644
--- a/lib/core/Head.js
+++ b/lib/core/Head.js
@@ -149,6 +149,33 @@ class Head extends React.Component {
);
})}
+ {this.props.config.scrollToTop && (
+
+ )}
+ {this.props.config.scrollToTop && (
+
+ )}
+
{/* Site defined code. Keep these at the end to avoid overriding. */}
))}
+
{process.env.NODE_ENV === 'development' && (