Skip to content

UseAllFive/react-native-alphabet-flat-list

 
 

Repository files navigation

   react-native-alphabet-flat-list    react-native-alphabet-flat-list

Alphabet FlatList

Installation

  • Using npm: npm install @yoonzm/react-native-alphabet-flat-list --save
  • Using Yarn: yarn add @yoonzm/react-native-alphabet-flat-list

Example

import React, { Component } from 'react';
import { Text, View } from 'react-native';
import SWAlphabetFlatList from '@yoonzm/react-native-alphabet-flat-list';

const CONTACTS = {
  A: ['Any', 'Avatar'],
  B: ['Basketball', 'Big']
};

const ITEM_HEIGHT = 50;

class Example extends Component {
  render() {
    return (
      <SWAlphabetFlatList
        data={CONTACTS}
        renderItem={({ item }) => (
          <View style={{ height: ITEM_HEIGHT }}>
            <Text>{item}</Text>
          </View>
        )}
        itemHeight={ITEM_HEIGHT}
      />
    );
  }
}

Props

  • data(Object) [isRequire] - listData to display
  • itemHeight(Number) [isRequire] - itemComponent height
  • renderItem(Function) [isRequire] - itemComponent render
  • sectionHeaderHeight(Number) - sectionHeader height; default is 25
  • sectionHeaderComponent(Component) - sectionHeader

License

About

使用FlatList制作的react-native字母选择列表

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%