id | e.g. null, 'your-custom-id-1', 'your-custom-id-1', etc. | null | The id attribute of the element you want to scroll to. If the value is null, the browser scrolls to top of the page. In this case, you do not need to change this parameter. Most users leave this setting by default. |
title | e.g. null, 'Scroll to top', 'Back to top', etc. | 'Back to top' | The title and the aria-label of the button. |
zIndex | e.g. null, 1000, 1111111111, etc. | 1000 | The z-index of the button. |
theme | e.g. 'theme-white', 'theme-light', 'theme-midtone', 'theme-dark', 'theme-black', 'theme-1', 'theme-2', ... 'theme-10', etc. | 'theme-black' | The theme of the button. You can override the theme by using further options such as bgColor, iconColor, etc. |
position | 'bottom-left', 'bottom-center', 'bottom-right', 'top-left', 'top-center', 'top-right', 'center-left', 'center-right' | 'bottom-right' | The position where the button appears. |
displayOffset | 1000, 1200, 1500, etc. | 1000 | If the scroll position exceeds this value, the button appears. The value must be specified in pixels. |
buttonAnimationType | 'none', 'fade', 'zoom' | 'zoom' | The animation type how the button appears. |
scrollAnimationDuration | e.g. 500, 750, 1000, etc. | 500 | The duration time of the scroll animation in milliseconds. |
margin | e.g. null, '10px', '20px', '30px', etc. | null | The margin of the button. |
width | e.g. null, '48px', '56px', '60px', etc. | null | The width of the button. |
height | e.g. null, '48px', '56px', '60px', etc. | null | The height of the button. |
borderWidth | e.g. '0px', '2px', '5px', etc. | '0px' | The border width of the button. |
borderColor | e.g. 'transparent', '#000', '#454545', '#fff', etc. | '#fff' | The border color of the button. |
borderColorHover | e.g. 'transparent', '#000', '#454545', '#fff', etc. | '#fff' | The border color of the button in hover state. |
borderColorFocus | e.g. 'transparent', '#000', '#454545', '#fff', etc. | '#fff' | The border color of the button in focus state. |
borderColorActive | e.g. 'transparent', '#000', '#454545', '#fff', etc. | '#fff' | The border color of the button in active state. |
borderRadius | e.g. '0px', '4px', '50%', '999px', '12px 0px 12px 0px', etc. | '999px' | The radius of border for the button. |
bgColor | e.g. null, '#454545', '#369', '#000', '#fff', etc. | null | The background color of the button. |
bgColorOpacity | e.g. 0.5, 0.6, 0.85, etc. | 1 | The background color transparency of the button. The bgColor is required to use it. |
bgColorHover | e.g. null, '#454545', '#369', '#000', '#fff', etc. | null | The background color of the button in hover state. |
bgColorOpacityHover | e.g. 0.5, 0.6, 0.85, etc. | 1 | The background color transparency of the button in hover state. The bgColorHover is required to use it. |
bgColorFocus | e.g. null, '#454545', '#369', '#000', '#fff', etc. | null | The background color of the button in focus state. |
bgColorOpacityFocus | e.g. 0.5, 0.6, 0.85, etc. | 1 | The background color transparency of the button in focus state. The bgColorFocus is required to use it. |
bgColorActive | e.g. null, '#454545', '#369', '#000', '#fff', etc. | null | The background color of the button in active state. |
bgColorOpacityActive | e.g. 0.5, 0.6, 0.85, etc. | 1 | The background color transparency of the button in active state. The bgColorActive is required to use it. |
boxShadowEnabled | true, false | true | Enable or disable the shadow of the button. If the value is true, the shadow appears. If the value is false, the shadow does not appear. |
boxShadowHorizontalOffset | e.g. '0px', '10px', etc. | '0px' | The horizontal offset of the shadow. The boxShadowEnabled is required to use it. |
boxShadowVerticalOffset | e.g. '0px', '10px', etc. | '0px' | The vertical offset of the shadow. The boxShadowEnabled is required to use it. |
boxShadowBlur | e.g. '5px', '10px', '30px', etc. | '30px' | The blur of the shadow. The boxShadowEnabled is required to use it. |
boxShadowSpread | e.g. '0px', '10px', '30px', etc. | '0px' | The spread of the shadow. The boxShadowEnabled is required to use it. |
boxShadowColor | e.g. '#000', '#454545', etc. | '#000' | The color of the shadow. The boxShadowEnabled is required to use it. |
boxShadowOpacity | e.g. 0.05, 0.5, 0.8, 1, etc. | 0.05 | The transparency of the shadow. The boxShadowEnabled is required to use it. |
iconType | e.g. 'icon1', 'icon2', 'icon3', 'icon4', 'custom' | 'icon1' | The type of the icon. With setting the 'custom' value, you can add your own element. If your website uses a third-party font-based library, such as Font Awesome, you can also use it. With the other values (e.g. icon1, icon2, etc.), you can choose from predefined icons. |
iconCustomElement | e.g. '<i class="elegant-scroll-to-top__icon fas fa-arrow-up"></i>', '<svg class="elegant-scroll-to-top__icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24">...</svg>', etc. | null | A custom element you want to use instead of a predefined icon. To achieve this, set the value of iconType to 'custom'. If you want the options of the icon (e.g. iconSize, iconColor) to be applied, it is important to add the "elegant-scroll-to-top__icon" class to your custom element. For example '' |
iconSize | e.g. '16px', '1em', '2em', etc. | '16px' | The size of the icon. If you use a predefined icon (e.g. icon1, icon2, etc.), the iconSize parameter applies as width and height CSS properties. If you use the iconType parameter width 'custom' value, the size applies as a font-size CSS property. |
iconColor | e.g. null, '#333', '#369', '#454545', '#fff', 'currentColor', etc. | null | The color of the icon. If you use a predefined icon (e.g. icon1, icon2, etc.), the color applies as a fill color. If you use the iconType parameter width 'custom' value, the color applies as a CSS color property. |
iconColorHover | e.g. null, '#333', '#369', '#454545', '#fff', 'currentColor', etc. | null | The color of the icon in hover state. If you use a predefined icon (e.g. icon1, icon2, etc.), the color applies as a fill color. If you use the iconType parameter width 'custom' value, the color applies as a CSS color property. |
iconColorFocus | e.g. null, '#333', '#369', '#454545', '#fff', 'currentColor', etc. | null | The color of the icon in focus state. If you use a predefined icon (e.g. icon1, icon2, etc.), the color applies as a fill color. If you use the iconType parameter width 'custom' value, the color applies as a CSS color property. |
iconColorActive | e.g. null, '#333', '#369', '#454545', '#fff', 'currentColor', etc. | null | The color of the icon in active state. If you use a predefined icon (e.g. icon1, icon2, etc.), the color applies as a fill color. If you use the iconType parameter width 'custom' value, the color applies as a CSS color property. |
onShow | e.g. function () { console.log('Scroll button has appeared'); } | null | You can call this function when the scroll button has appeared. |
onHide | e.g. function () { console.log('Scroll button has disappeared'); } | null | You can call this function when the scroll button has disappeared. |
onScrollStart | e.g. function () { console.log('Scrolling has started'); } | null | You can call this function when the scrolling has started. |
onScrollEnd | e.g. function () { console.log('Scrolling has ended'); } | null | You can call this function when the scrolling has ended. |