All Projects → wangtao0101 → react-list-any-height

wangtao0101 / react-list-any-height

Licence: MIT license
React scroll list for item with any height

Programming Languages

javascript
184084 projects - #8 most used programming language
CSS
56736 projects

Projects that are alternatives of or similar to react-list-any-height

render-props
㸚 Easy-to-use React state containers which utilize the render props (function as child) pattern
Stars: ✭ 33 (+175%)
Mutual labels:  scrolling
FlexibleHeader
A container view that responds to scrolling of UIScrollView
Stars: ✭ 69 (+475%)
Mutual labels:  scrolling
just-scroll
Simple indicate the possibility of scrolling on a page with СSS3 animation.
Stars: ✭ 34 (+183.33%)
Mutual labels:  scrolling
react-scroll-locky
📜🔒 – React full-cream "anti-scroll" library, you were looking for
Stars: ✭ 55 (+358.33%)
Mutual labels:  scrolling
onscroll-effect
A tiny JavaScript library to enable CSS animations when user scrolls.
Stars: ✭ 35 (+191.67%)
Mutual labels:  scrolling
jquery-scrollwatch
jQuery plugin for determining active sections on the page based on scrolling
Stars: ✭ 18 (+50%)
Mutual labels:  scrolling
body-scroll-freezer
↕️ Dependency-free JS module to freeze body scroll when opening modal box
Stars: ✭ 22 (+83.33%)
Mutual labels:  scrolling
linearmouse
🖱 The mouse and trackpad utility for Mac.
Stars: ✭ 1,151 (+9491.67%)
Mutual labels:  scrolling
NoobScroll
A lightweight jQuery Plugin that add some cool function to make scrolling more fun [Archive]
Stars: ✭ 43 (+258.33%)
Mutual labels:  scrolling
vue-in-viewport-mixin
Vue 2 mixin to determine when a DOM element is visible in the client window
Stars: ✭ 99 (+725%)
Mutual labels:  scrolling
react-custom-scroller
Super simple React component for creating a custom scrollbar cross-browser and cross-devices.
Stars: ✭ 30 (+150%)
Mutual labels:  scrolling
react-scroll-trigger
📜 React component that monitors scroll events to trigger callbacks when it enters, exits and progresses through the viewport. All callback include the progress and velocity of the scrolling, in the event you want to manipulate stuff based on those values.
Stars: ✭ 126 (+950%)
Mutual labels:  scrolling
2DUICollectionViewSwift
A simple and elegant 2Dimensional UICollectionView which is most commonly used in ecommerce apps, music streaming apps etc. Easily customisable as per your requirements as it is designed keeping the superset requirement in mind. Developed in latest Swift syntax.
Stars: ✭ 28 (+133.33%)
Mutual labels:  scrolling
marquee-ora
A tool to create an ora compatible spinner object that behaves like a scrolling marquee
Stars: ✭ 73 (+508.33%)
Mutual labels:  scrolling
really-smooth-scroll
A script that smoothen scrolling in the browser
Stars: ✭ 21 (+75%)
Mutual labels:  scrolling
scroll-sync-react
A scroll syncing library for react that is up to date
Stars: ✭ 49 (+308.33%)
Mutual labels:  scrolling
react-smart-scroll
Efficient rendering of long lists in React
Stars: ✭ 27 (+125%)
Mutual labels:  scrolling
EasyScrollDots
Single page scroll JavaScript plugin that allows for vertical navigation of page sections
Stars: ✭ 38 (+216.67%)
Mutual labels:  scrolling
angular-scrollspy
A simple lightweight library for Angular which automatically updates links to indicate the currently active section in the viewport
Stars: ✭ 34 (+183.33%)
Mutual labels:  scrolling
cachu-slider
🌈 🔆 Create animated full screen and content-fit sliders efficiently.
Stars: ✭ 30 (+150%)
Mutual labels:  scrolling

react-list-any-height

React scroll list for item with any height.

Example: https://wangtao0101.github.io/react-list-any-height/

Motivation

react virtualized and react-infinite can only handle list with fixed height, but that may not always be the case.

Install

npm install react-list-any-height --save
yarn add react-list-any-height

Basic Use

Elements of Any Height

As we don't know the height of all row before the row had been rendered, we figure out the height of contianer by using minRowHeight.

<AnyHeight
    dataSource={dataSource}
    minRowHeight={100}
    rowRender={(index, style) => (
        <div className="hover-row" style={style)}></div>
    )}
/>

How to work

We figure out the origin height of contianer by using minRowHeight. After you scroll and the more row will be rendered, we using new heights to update component in next scrolling.

Note on Smooth Scrolling

minRowHeight should be set reasonable, otherwise if you scroll to end fastly and then you scroll to up slowly, then page will jump.

Api

dataSource

the data array, isRequired

minRowHeight

The minimum height of all rows, isRequired

height

The height of scrolling contianer, default to 300.

preloadBatchSize

The items rendered out of contianer, default to 5.

style

The style of contianer, default to style: { width: '100%' }.

rowStyle

The style of row

rowRender

A function for rendering a row, isRequired

timeScrollStateLastsForAfterUserScrolls(same as react-infinite)

Defaults to 150 (in milliseconds). On Apple and some other devices, scroll is inertial. This means that the window continues to scroll for several hundred milliseconds after an onScroll event is fired. To prevent janky behavior, we do not want pointer-events to reactivate before the window has finished moving. Setting this parameter causes the Infinite component to think that the user is still scrolling for the specified number of milliseconds after the last onScroll event is received.

Thanks

Some code from react-infinite

Roadmap

  • full test
  • Using the Window to Scroll
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].