Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A simple React Native component that takes an array of data and renders a section with alphabetically sorted data

License

NotificationsYou must be signed in to change notification settings

CofferHub/react-native-section-alphabet

 
 

Repository files navigation

sectionlist

PRs Welcome

A simple React Native component that takes an array of data and renders a SectionList with alphabetically sorted data.

Alt text

This package_uses the array of objects data-structure.

constdata=[{...},{...},{...}, ...]

Forreact-native-flatlist-alphabet, the data does not need to be pre-formatted and sorted before use. The component handles all this logic internally.

Installation

Using npm:

npm install react-native-flatlist-alphabet

or with yarn:

yarn add react-native-flatlist-alphabet

Usage

Import the module

importAlphabetListfrom"react-native-flatlist-alphabet";

Use the component

<AlphabetListdata={YourData}renderItem={YourRenderItemFunction}renderSectionHeader={YourRenderSectionHeaderFunction}getItemHeight={YourItemHeight}sectionHeaderHeight={YourHeaderHeight}indexLetterColor={ColorOfTheIndexSidebarLetters}/>

YourData should be provided as an Array of objects, with each object item having both avalueand akey.

constYourData=[{value:string,// determines which alphabet section to place the object inkey:string// used as the key in the keyExtractor for SectionList...// your other properties},  ...]

Props

OptionDescriptionDefault
sectionDataThe array of objects data with value and key.-
renderItemRender the alphabet letter header.JSX
renderSectionHeaderRender the alphabet letter header.JSX
indexLetterColorThe alphabet letter font-size.#0B3277
indexLetterSizeThe alphabet letter font-size.16
letterIndexWidthThe alphabet letter index width size.#0B3277
sectionHeaderHeightThe section header defines each alphabet title header size.40
getItemHeightReturns the each item height position size.30
letterItemStyleThe container letter item style.-
containerStyleThe alphabet wrapper container style.-
alphabetContainerThe flatlist alphabet container style.-
styleThe sectionlist container style.-

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update the tests as appropriate.

License

MIT

About

A simple React Native component that takes an array of data and renders a section with alphabetically sorted data

Topics

Resources

License

Stars

Watchers

Forks

Languages

  • TypeScript60.6%
  • JavaScript20.2%
  • Objective-C7.0%
  • Ruby4.6%
  • Java4.4%
  • Starlark3.2%

[8]ページ先頭

©2009-2025 Movatter.jp