back-to-top-arrow

0.1.1 • Public • Published

Back To Top Arrow

Simple customizable Vanilla JS back to top arrow.

Installation

npm i back-to-top-arrow

Usage

Import package

import backToTop from 'back-to-top-arrow';

Import stylesheet

import './node_modules/back-to-top-arrow/back-to-top.css';

Call the function

backToTop();

Function can take 4 arguments, if none are passed, default values are used.

No. Property Default Type Description
1. Depth 0.4 Number Scroll depth at which the arrow appears (0 - 1)
2. Background color #a8a7a String Color of the background area
3. Background on hover #ebe8e8 String Color of the background area on hover
4. Arrow color #1f1e1e String Color of the arrow

Example usage with custom settings

backToTop(0.6, '#000', '#2e2d2d', '#fff');

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i back-to-top-arrow

Weekly Downloads

2

Version

0.1.1

License

MIT

Unpacked Size

4.33 kB

Total Files

4

Last publish

Collaborators

  • lubosz