Socket
Socket
Sign inDemoInstall

@brianmcallister/react-auto-scroll

Package Overview
Dependencies
9
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @brianmcallister/react-auto-scroll

Automatically scroll an element to the bottom


Version published
Weekly downloads
234
increased by0.86%
Maintainers
1
Install size
30.4 kB
Created
Weekly downloads
 

Readme

Source

@brianmcallister/react-auto-scroll

codecov CircleCI npm version

Automatically scroll an element to the bottom

react-auto-scroll is a React component that automatically scrolls a containing element to the bottom.

Table of contents

Demo

Hosted demo: https://react-auto-scroll.netlify.com/

You can also run the demo locally. To get started:

git clone git@github.com:brianmcallister/react-auto-scroll.git
cd react-auto-scroll/demo
npm i
# Optionally link libraries for local development
npm link @brianmcallister/react-auto-scroll
npm link ../node_modules/react
npm start
⇡ Top

Installation

npm install @brianmcallister/react-auto-scroll
⇡ Top

Usage

import AutoScroll from '@brianmcallister/react-auto-scroll';

const MyComponent = ({ someContent }) => (
  <AutoScroll>
    {someContent}
  </AutoScroll>
);
⇡ Top

API

AutoScroll

This is the default export. Use this React component to scroll a container to the bottom when the children change.

interface Props {
  // ID attribute of the checkbox.
  checkBoxId?: string;
  // Children to render in the scroll container.
  children: React.ReactNode;
  // Extra CSS class names.
  className?: string;
  // Height value of the scroll container.
  height?: number;
  // Text to use for the auto scroll option.
  optionText?: string;
  // Prevent all mouse interaction with the scroll conatiner.
  preventInteraction?: boolean;
    // Ability to disable the smooth scrolling behavior.
  scrollBehavior?: 'smooth' | 'auto';
  // Show the auto scroll option.
  showOption?: boolean;
}
⇡ Top

Keywords

FAQs

Last updated on 01 Sep 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc