# react-native-alphabet-sectionlist

> Based on SectionList, list with a sidebar to jump to sections directly

Latest version **0.0.4** (published 2019-11-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-native-alphabet-sectionlist
pnpm add react-native-alphabet-sectionlist
yarn add react-native-alphabet-sectionlist
bun add react-native-alphabet-sectionlist
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.4 |
| Published | 2019-11-08 |
| First published | 2019-11-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 15.2 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 18 |
| Author | CoderJeryy |
| Maintainers | coderjerry |
| Keywords | react-native, iOS, android, sectionlist, contacts, addressbook, alphabet |

## Links

- npm: https://www.npmjs.com/package/react-native-alphabet-sectionlist
- Repository: https://github.com/CoderJWYang/react-native-alphabet-sectionlist
- Homepage: https://github.com/CoderJWYang/react-native-alphabet-sectionlist#readme
- Issues: https://github.com/CoderJWYang/react-native-alphabet-sectionlist/issues
- npm.io page: https://npm.io/package/react-native-alphabet-sectionlist

## Dependencies (2)

- [merge](https://npm.io/package/merge.md) ^1.2.1
- [prop-types](https://npm.io/package/prop-types.md) ^15.7.2

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 0.0.4 (latest) — 2019-11-08
- 0.0.3 — 2019-11-08
- 0.0.2 — 2019-11-07
- 0.0.1 — 2019-11-07

## README

### Due to ListView is deprecated, This component is based on React Native SectionList.

## Install:
```
npm install react-native-alphabet-sectionlist  --save  
```


![list drag](https://media.giphy.com/media/LoOblHwbabTnwP4qzk/giphy.gif) 


## Usage

The most basic way to use this component is as follows:

```javascript

<AlphabetSectionList
  data={this.state.data}
  renderItem={this.renderItem}
  renderHeader={this.renderHeader}
  // custom section header
  renderSectionHeader={this.renderSectionHeader}
  // default section header styles
  sectionHeaderStyle={{ paddingVertical: 5 }}
  sectionHeaderTextStyle={{ fontSize: 16, color: 'blue' }}
/>

```

You can find a more complete example below

## Example

```javascript
import React from 'react';
import {
  View,
  Text,
} from 'react-native';
import AlphabetSectionList from 'react-native-alphabet-sectionlist';

class App extends React.Component {

  constructor(props) {
    super(props);

    this.state = {
      data: {
        'A': [{ name: 'A1' }, { name: 'A2' }, { name: 'A3' }],
        "E": [{ name: 'E1' }, { name: 'E2' }, { name: 'E3' }, { name: 'E4' }],
        'F': [{ name: 'F1' }, { name: 'F2' }, { name: 'F3' }],
        'H': [{ name: 'H1' }, { name: 'H2' }, { name: 'H3' }, { name: 'H5' }],
        'J': [{ name: 'J1' }, { name: 'J2' }, { name: 'J3' }, { name: 'J5' }],
        'K': [{ name: 'K1' }, { name: 'K2' }, { name: 'K3' }, { name: 'K5' }],
        'N': [{ name: 'N1' }, { name: 'N2' }, { name: 'N3' }, { name: 'N5' }],
        'Y': [{ name: 'Y1' }, { name: 'Y2' }, { name: 'Y3' }, { name: 'Y5' }, { name: 'Y6' }],
      },
    }

  }

  renderItem = ({ item }) => {
    return (
      <View style={{
        marginLeft: 10,
        paddingVertical: 10,
        borderBottomColor: 'lightgray',
        borderBottomWidth: 0.5
      }}>
        <Text>{item.name}</Text>
      </View>
    )
  }

  renderHeader = () => {
    return (
      <View>
        <Text>header1</Text>
        <Text>header2</Text>
      </View>
    )
  }

  renderSectionHeader = ({ section: { title } }) => {
    return (
      <View style={{
        paddingLeft: 10,
        backgroundColor: '#f1f2f3',
        paddingVertical: 5,
      }}>
        <Text style={{ color: 'blue' }}>{title}</Text>
      </View>
    )
  }

  render() {
    return (
      <View style={{ flex: 1 }}>
        <AlphabetSectionList
          data={this.state.data}
          renderItem={this.renderItem}
          renderHeader={this.renderHeader}
          // custom section header
          renderSectionHeader={this.renderSectionHeader}
          // default section header styles
          // sectionHeaderStyle={{ paddingVertical: 5 }}
          // sectionHeaderTextStyle={{ fontSize: 16, color: 'blue' }}
        />
      </View>
    )
  }
}

export default App;
```

---
_Source: https://npm.io/package/react-native-alphabet-sectionlist · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
