@proangular/ngx-scroll-top
Version:
Configurable, lightweight back to top button for Angular projects.
93 lines (90 loc) • 3.23 kB
TypeScript
import * as i0 from '@angular/core';
import { OnInit } from '@angular/core';
declare class NgxScrollTopComponent implements OnInit {
/**
* Background color of the back to top button (hex string).
*
* Default: `'#0D58C0'` (dark-blue)
*
* Example: `'#000'` or `'black'`
*
* Tip: Define any `'x'` css property available for `'background-color: x'`
*/
backgroundColor: string;
/**
* Offset `px` from bottom of page when scrolled to bottom. For example this
* can be used to make sure the back to top button never overlaps a footer.
*
* Default: `'0px'`
*
* Example: `'250px'` or `250` because my footer is 250px in height
*/
bottomOffset: string | number;
/**
* The back to top button will not be displayed until the user scrolls to the
* provided Y (vertical `px`) coordinate on the page.
*
* Default: `'420px'`
*
* Example: `'100px'` or `100`
*/
displayAtYPosition: string | number;
/**
* The font color for the nested content within the back to top button.
*
* Default: `'#FFFFFF'` (white)
*
* Example: `'#000'` or `'black'`
*
* Tip: Define any `'x'` css property available for `'color: x'`
*/
fontColor: string;
/**
* The font size for the nested content within the back to top button.
*
* Default: `'16px'`
*
* Example: `'2rem'` or `'32px'`
*
* Tip: Define any `'x'` css property available for `'font-size: x'`
*/
fontSize: string;
/**
* Height of back to top button in string px format.
*
* Default: `'25px'`
*/
height: string;
/**
* Position on-screen where the back to top button is displayed.
*
* Default: `'right'`
*/
position: 'left' | 'right';
/**
* Width of back to top button in string px format.
*
* Default: `'25px'`
*/
width: string;
/**
* Style the `z-index` for the back to top button as needed for correct layer
* height adjustment. This can be useful when working with sticky headers.
*
* Default: `999`
*/
zIndex: number;
isHidden: boolean;
private readonly defaultPadding;
styleBottom: string;
styleLeft: string;
styleRight: string;
onWindowScroll(): void;
ngOnInit(): void;
scrollTop(): void;
private updatePosition;
private updateIsHidden;
static ɵfac: i0.ɵɵFactoryDeclaration<NgxScrollTopComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<NgxScrollTopComponent, "ngx-scroll-top", never, { "backgroundColor": { "alias": "backgroundColor"; "required": false; }; "bottomOffset": { "alias": "bottomOffset"; "required": false; }; "displayAtYPosition": { "alias": "displayAtYPosition"; "required": false; }; "fontColor": { "alias": "fontColor"; "required": false; }; "fontSize": { "alias": "fontSize"; "required": false; }; "height": { "alias": "height"; "required": false; }; "position": { "alias": "position"; "required": false; }; "width": { "alias": "width"; "required": false; }; "zIndex": { "alias": "zIndex"; "required": false; }; }, {}, never, ["*"], true, never>;
}
export { NgxScrollTopComponent };