react-scroll-button
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

react-scroll-button

npm version

Live Demo

Demo

How to Install

npm i react-scroll-button

Usage

import React from 'react';
import ScrollButton from 'react-scroll-button';

const ScrollComponent = () => {
  return (
    <ScrollButton
      behavior="smooth"
      buttonBackgroundColor="red"
      iconType="arrowUp"
      style={{ fontSize: '24px' }}
    />
  );
};

Properties

Property Description DefaultValue Type
targetId Id of element that you want to go '' string
behavior Scroll type. 'auto', 'smooth' auto string
buttonBackgroundColor BackgroundColor of button 'green' string
buttonColor Color of icon 'white' string
iconType Icon type 'up','arrowUp', 'caretUp' 'up' string
scrollSpeed It specifies speed of the scroll button. '1s' string
buttonVisibleHeight It specifies that the scroll button will be visible at what height on the page 50 number
style Write custom css properties { } object

License MIT

Package Sidebar

Install

npm i react-scroll-button

Weekly Downloads

49

Version

2.0.0

License

MIT

Unpacked Size

236 kB

Total Files

10

Last publish

Collaborators

  • isagul