0.2.3 • Published 2 years ago

react-simple-scroll-up v0.2.3

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

React Simple Scroll up (back to top)

A minimal lightweight react component for adding a nice scroll up (back to top) with onScroll progress.

NPM JavaScript Style Guidenpm bundle sizeGitHub

Install

npm

npm i react-simple-scroll-up

Yarn

yarn add react-simple-scroll-up

Examples

import React from 'react'
import { ScrollToTop } from 'react-simple-scroll-up'

const MyComponent = () => {
  return (
    <div className='App'>
      <ScrollToTop {/* Props */} />
    </div>
  )
}

Props

PropTypeOptionsDescriptionDefault
sizenumberOptionalSet button width and height (in pixels)50
offsetTopnumberOptionalShow button after number of pixels that document has scrolled vertically100
bgColorstringOptionalButton background colorrgb(0 0 0 / 75%)
strokeWidthnumberOptionalScroll progess bar width (in pixels)4
strokeFillColorstringOptionalScroll progess bar fill colorrgb(0 0 0 / 50%)
strokeEmptyColorstringOptionalScroll progess bar empty colorrgb(200 200 200 / 85%)
symbolstring or ReactNodeOptionalUse any HTML Symbols by simply copy/paste it OR any custom element, e.g. FontAwesomeIcon🡩
symbolSizenumberOptionalSymbol font size (in pixels). Only applies when symbol is a string.20
symbolColorstringOptionalSymbol color.#fff
onScrollingfunctionOptionalCallback function that is triggered while scrolling with value passed-
onScrollEndfunctionOptionalCallback function that is triggered when scroll is ended-
classNamestringOptionalCSS class nameto-top-progress
styleReact.CSSPropertiesOptionalCSS style-

Edit react-simple-scroll-up

License

MIT © awran5

0.2.1

2 years ago

0.2.3

2 years ago

0.2.0

2 years ago

0.1.0

3 years ago