Coder Social home page Coder Social logo

zhengdian1024 / react-mobile-list Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 0.0 4 KB

A List with infinite scrolling like RN FlatList without pull-to-refresh for mobile or pc web

JavaScript 97.23% CSS 2.77%
react list listview react-list react-mobile react-mobile-list

react-mobile-list's Introduction

react-mobile-list

A List with infinite scrolling like RN FlatList without pull-to-refresh for mobile or pc web

Simple example

const renderItem = (item, index) => <div>{item.name}</div>

<List
  data={dataList}
  renderItem={renderItem}
  keyExtractor={(item, index) => item.id}
  ItemSeparatorWidth={8}
  ItemSeparatorColor='#f7f7f7'
  onEndReached={() => { console.log('end') }}
/>

API and Configuration:

Property Type Default Description
data Array [] Your list data.
renderItem Function Required renderItem({ item: Object, index: Number }) Takes an item from data and renders it into the list.
ItemClassName String className for items.
ItemSeparatorWidth Number 1 Rendered in between each item, but not at the top or bottom.
ItemSeparatorColor String #e8e8e8 borderColor.
ListEmptyComponent Function Component Element Rendered when the list is empty. Can be a React Component Class, a render function, or a rendered element.
ListFooterComponent Function Component Element Rendered at the bottom of all the items. Can be a React Component Class, a render function, or a rendered element.
ListHeaderComponent Function Component Element Rendered at the top of all the items. Can be a React Component Class, a render function, or a rendered element.
keyExtractor Function Required (item: object, index: number) => string
onEndReached Function Called once when the scroll position gets within onEndReachedThreshold of the rendered content.
onEndReachedThreshold Number 100 How far from the end the bottom edge of the list must be from the end of the content to trigger the onEndReached callback. Thus a value of 100 will trigger onEndReached when the end of the content is within 100px visible length of the list.

Installation

npm install react-mobile-list --save

react-mobile-list's People

Contributors

zhengdian1024 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.