- FlatList-based (not SectionList)
- Automatically sorts and groups items by any field
- Alphabet index on the right side (A–Z)
- Smart scroll to each letter’s first item
- Optional letter headers
- Configurable styles for headers, items, and alphabet list
- Shows full A–Z even if data doesn't cover all letters
- Built-in TypeScript support
npm install react-native-letter-flatlistimport React from 'react';
import { SafeAreaView, StyleSheet } from 'react-native';
import { AlphabetList } from 'react-native-letter-flatlist';
const people = [
{ name: 'Alice' },
{ name: 'Amanda' },
{ name: 'Ben' },
{ name: 'Charlie' },
{ name: 'David' },
{ name: 'Eve' },
{ name: 'Frank' },
{ name: 'Zack' },
];
export default function App() {
return (
<SafeAreaView style={styles.container}>
<AlphabetList
data={people}
sortField="name"
showHeader={true}
showAllLetters={true}
/>
</SafeAreaView>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
},
});| Prop | Type | Default | Description |
|---|---|---|---|
data |
T[] |
— | The array of items to display. |
sortField |
keyof T |
— | The key used to group and sort items alphabetically. |
renderItem |
(item: T) => ReactElement |
Default | Optional custom render for each item. |
renderHeader |
(letter: string) => ReactElement |
Default | Optional custom render for each alphabet header. |
showHeader |
boolean |
true |
Whether to show alphabet headers above each section. |
showAllLetters |
boolean |
false |
Whether to show all A–Z even if no items exist under some letters. |
itemHeight |
number |
40 |
Height for each item row (for scroll positioning). |
headerHeight |
number |
40 |
Height for each header row (for scroll positioning). |
itemTextStyle |
TextStyle |
— | Style override for default item text. |
headerContainerStyle |
ViewStyle |
— | Style override for default header container. |
headerTextStyle |
TextStyle |
— | Style override for default header text. |
activeAlphabetStyle |
TextStyle |
— | Style for active (clickable) letters in the right-side index. |
inactiveAlphabetStyle |
TextStyle |
— | Style for inactive (non-clickable) letters in the right-side index. |
alphabetContainerStyles |
ViewStyle |
— | Style for the container of the right-side alphabet list. |
| Prop | Type | Description |
|---|---|---|
itemTextStyle |
TextStyle |
Style override for the default item text. |
headerContainerStyle |
ViewStyle |
Style override for the default header container. |
headerTextStyle |
TextStyle |
Style override for the default header text. |
activeAlphabetStyle |
TextStyle |
Style for active (clickable) alphabet letters in the right-side index. |
inactiveAlphabetStyle |
TextStyle |
Style for inactive (non-clickable) alphabet letters in the right-side index. |
alphabetContainerStyles |
ViewStyle |
Style for the vertical container of the right-side A–Z index. |
- Outer container height of AlphabetList must be greater than or euqal to the alphabets height for better performance
To use default rendering:
- You can skip
renderItemand/orrenderHeader— default components will be used. - Set
showHeader={false}to hide alphabet section headers entirely. - Enable
showAllLetters={true}to display all A–Z letters on the right side, even if some letters have no matching data (they will appear disabled).
Made with ❤️ by Antos Maman
- GitHub
- For issues and contributions, feel free to open a GitHub issue
MIT Copyright (c) 2025 Antos Maman
