All Projects → huangbinjie → React Scroll

huangbinjie / React Scroll

Licence: mit
Effortless to get the twitter level infinite scroll implementation by only a bit of props

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to React Scroll

Vue Mugen Scroll
Infinite scroll component for Vue.js 2
Stars: ✭ 532 (+618.92%)
Mutual labels:  infinite-scroll
Flatlist React
A helpful utility component to handle lists in react like a champ
Stars: ✭ 34 (-54.05%)
Mutual labels:  infinite-scroll
Jscroll
An infinite scrolling plugin for jQuery.
Stars: ✭ 1,084 (+1364.86%)
Mutual labels:  infinite-scroll
Vue Pull To
⚡️ A pull-down refresh and pull-up load more and infinite scroll component for Vue.js --Vue下拉刷新组件
Stars: ✭ 708 (+856.76%)
Mutual labels:  infinite-scroll
Django Starcross Gallery
Django Gallery app with justified image layout, infinite scrolling and drag & drop support
Stars: ✭ 28 (-62.16%)
Mutual labels:  infinite-scroll
Google Books Android Viewer
Android library to bridge between RecyclerView and sources like web page or database. Includes demonstrator (Google Books viewer)
Stars: ✭ 37 (-50%)
Mutual labels:  infinite-scroll
Vegile
This tool will setting up your backdoor/rootkits when backdoor already setup it will be hidden your spesisifc process,unlimited your session in metasploit and transparent. Even when it killed, it will re-run again. There always be a procces which while run another process,So we can assume that this procces is unstopable like a Ghost in The Shell
Stars: ✭ 478 (+545.95%)
Mutual labels:  infinite-scroll
Vue List Scroller
Simple and easy to use Vue.js component for efficient rendering large lists
Stars: ✭ 65 (-12.16%)
Mutual labels:  infinite-scroll
Uiscrollview Infinitescroll
UIScrollView ∞ scroll category
Stars: ✭ 957 (+1193.24%)
Mutual labels:  infinite-scroll
Practice
A clean timeline theme for the Ghost CMS
Stars: ✭ 46 (-37.84%)
Mutual labels:  infinite-scroll
Infinite Ajax Scroll
Turn your existing pagination into infinite scrolling pages with ease
Stars: ✭ 804 (+986.49%)
Mutual labels:  infinite-scroll
Rsdayflow
iOS 7+ Calendar (Date Picker) with Infinite Scrolling.
Stars: ✭ 843 (+1039.19%)
Mutual labels:  infinite-scroll
Flutter carousel slider
A flutter carousel widget, support infinite scroll, and custom child widget.
Stars: ✭ 998 (+1248.65%)
Mutual labels:  infinite-scroll
Infinitecycleviewpager
Infinite cycle ViewPager with two-way orientation and interactive effect.
Stars: ✭ 5,720 (+7629.73%)
Mutual labels:  infinite-scroll
React Ingrid
React infinite grid
Stars: ✭ 59 (-20.27%)
Mutual labels:  infinite-scroll
React Native Ultimate Listview
A high performance FlatList providing customised pull-to-refresh | auto-pagination & infinite-scrolling | gridview layout | swipeable-row.
Stars: ✭ 497 (+571.62%)
Mutual labels:  infinite-scroll
Viewprt
A tiny, dependency-free, high performance viewport position & intersection observation tool
Stars: ✭ 36 (-51.35%)
Mutual labels:  infinite-scroll
React Native Snap Carousel
Swiper/carousel component for React Native featuring previews, multiple layouts, parallax images, performant handling of huge numbers of items, and more. Compatible with Android & iOS.
Stars: ✭ 9,151 (+12266.22%)
Mutual labels:  infinite-scroll
React Infinite Tree
The infinite-tree library for React.
Stars: ✭ 63 (-14.86%)
Mutual labels:  infinite-scroll
Ngx Infinite Scroll
Infinite Scroll Directive for Angular
Stars: ✭ 1,024 (+1283.78%)
Mutual labels:  infinite-scroll

react-iscroller

An effective react infinite scroll container. inspired by twitter's blog.

Motivation

As the pwa(progressive web app) becoming more popular, the performance and user experience are more and more important. And infinite scroll is almost the most important part within a pwa project. But i found the results by searching react infinite scroller on github are not my needs. Fortunately, I found this article of twitter on medium by chance. That's i want. So I tried to make my own one.

Install

npm i react-iscroller

Example

It's simple to use as follow:

import { InfiniteScroller } from "react-iscroller"

return <InfiniteScroller
  itemAverageHeight={22}
  containerHeight={window.innerHeight}
  items={this.state.messages}
  itemKey="id"
  onRenderCell={this.renderCell}/>

Feature

  • infinite load
  • lazy load
  • dynamic height
  • pure component
  • cache
  • resize

Online Demo

image_and_text

Props

containerHeight(required): number

the height of the wrapper of the infinite scroller

className(optional): string

className attatched to scroller.

items(required): object[]

your data

itemKey(required): string

identity of your data. help scroller implements pure component.

itemAverageHeight(required): number

As the twitter blog mentioned, averageHeight can help scroller to guesstimate the buffer height. Usually your item height.

onRenderCell(required): (item: any, itemIndex: number) => ReactNode

called when trying to render an item. if you want to force scroller to update cache(eg. after image loaded), you can call this method.

cache(optional): Cache[]

cache the position of rendered item. your might need provide this prop when you want go back to the last place.

initialScrollTop(optional): number

set scroller's scrollTop to initialScrollTop after first render. if you had provied cache and initialScrollTop, you can get the last interface before unmount of scroller component.

onScroll(optional): (scrollerDom: HTMLDivElement) => void

called when scroller is scrolling.

onEnd?: () => void

called after anchor had arrived bottom.

Caveat

  • Your item which returned by onRenderCell will be wrapped by a div that used for calculation.

  • Because of the getBoundingClientRect, I can't get the margin size. So you should not use margin in your item css.

  • Because of the scroll bug in ios, if you suffered this problem, it's normally! However, I did some optimization for ios--avoid change scrollTop.

  • 2.x version is a bit heavy for dynamic height. If you can give your dynamic content a certain height, please use the version of 1.1.7.

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].