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

0.2.0 • Public • Published

react-scroll-end-pinner

GitHub license npm version Node.js CI

ScrollEndPinner is a React component for creating a scrollable area that stays scrolled to the end if the user has scrolled to the end when new content is added (or the content or the page is resized). This is useful for chat windows and logs.

TODO:

  • write readme with usage example
  • link to storybook example

Similar Techniques

This component gives a similar result as using the relatively new overflow-anchor: auto CSS rule as described in https://css-tricks.com/books/greatest-css-tricks/pin-scrolling-to-bottom/, but this component currently works in more browsers and doesn't require the element to be scrollable and scrolled first to take effect.

Assuming that the use of overflow-anchor: auto is as dependable as this component currently is, this component may be updated in the future to feature-detect overflow-anchor and use it when possible.

Types

TypeScript type definitions for this module are included!

Readme

Keywords

Package Sidebar

Install

npm i react-scroll-end-pinner

Weekly Downloads

0

Version

0.2.0

License

MIT

Unpacked Size

56.4 kB

Total Files

21

Last publish

Collaborators

  • macil