Giter Site home page Giter Site logo

rsp8055 / react-native-atoz-list Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rgovindji/react-native-atoz-list

1.0 0.0 0.0 130 KB

React Native Listview which handles large data sets and can scroll to sections using an alphabetical scroll list

JavaScript 94.80% Python 1.17% Java 0.88% Objective-C 3.14%

react-native-atoz-list's Introduction

This package is just a fork of the work of brentvatne: https://github.com/brentvatne/fixed-height-windowed-list-view-experiment

I fixed some issues with the scrolling not working correctly and exposed the main listview component as AtoZList. The scroll performance is great for large lists which is why I switched to using brentvatne's implementation.

Alt text

##Install

npm i -S react-native-atoz-list

##Usage

import AtoZList from 'react-native-atoz-list';

..
...

let myData = {
    'A': [{..}, {...}, {...}],
    'B': [{..}, {..}, {..}],
    'C': [{..}, {..}, {..}]
}

render(
    return(
        <AtoZList
                sectionHeaderHeight={20}
                cellHeight={60}
                data={myData}
                renderCell={this._renderCellComponent}
                renderSection={this._renderSectionComponent}
        />
    );


);

##Props Note: You need to set the section height and cellHeight

property Description
sectionHeaderHeight The height of each header section
cellHeight The height of each cellheightred
data The data that will be displayed. This should be an object in the format { 'A': [{..}, {..}], 'B': [{..}]}
renderCell This function will render you cell componenet. It will be passed the objects from each element in the data arrays.
renderSection This function will render your section headers. It will be passed an object with key 'sectionId'. The value of 'sectionId' will be the keys from your data object. i.e 'A', 'B', 'C' etc..
onEndReached Called when all rows have been rendered and the list has been scrolled to within onEndReachedThreshold of the bottom. The native scroll event is provided.

Authors

Raheel Govindji [email protected] brentvatne https://github.com/brentvatne

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.