1.0.1 • Published 4 years ago

react-scroll-top-btn v1.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

react-scroll-top-btn

React customize scroll to top button component

NPM JavaScript Style Guide

Install

npm install react-scroll-top-btn

If you are using yarn

yarn add react-scroll-top-btn

Import

import { Scroll } from 'react-scroll-top-btn'

Properties

PropertiesRequireDefaultDescriptionType
displayHeightoptional300Display the button at the specific scroll heightnumber
iconoptional"fas fa-arrow-up"Font-awesome icon class namestring
iconSizeoptional20The size of the font-awesome icon, px unitnumber
coloroptional"#000000"The color of the icon, hex code or rgb stylestring
bgSizeoptional40The width and height of the button box, px unitnumber
borderRadiusoptional"5px"The border raidus of the button box, e.g. "50%" or "5px"string
positionoptional"bottom-left" will display the button at the left bottom corner.string
xOffsetoptional0Offset x position of the button. e.g. -200 will move left -200pxnumber
yOffsetoptional0Offset y position of the button. e.g. -100 will move button up 100pxnumber
zIndexoptional0The z-index value of the button.number

Usage

import React from 'react'
import { Scroll } from 'react-scroll-top-btn'

export const App: React.FC = () => {
  return (
    <div>
      {/* Some dummy text ... */}
      <Scroll />
    </div>
  )
}

Uninstall

In your project directory, run

npm uninstall react-scroll-top-btn

If you are using yarn

yarn remove react-scroll-top-btn

ChangeLog

  • 2020/07/10 version 1.0.1 publish

License

MIT © yang052513