- Fully cross-platform
- Configurable viewability callbacks
- List header support
- List footer support
- Item separator support
- Section header support
- Section separator support
- Heterogeneous data and item rendering support
- Pull to refresh
- Scroll loading
Example
Props
Array<SectionT>
required
The actual data to render, akin to the
data prop in FlatList. Each section object should contain:data: Array of items in the sectionrenderItem: Optional custom renderer for items in this sectionItemSeparatorComponent: Optional custom separator for this section
(info: SectionListRenderItemInfo<ItemT>) => React.Element | null
Default renderer for every item in every section. Can be overridden on a per-section basis.
(info: {section: SectionT}) => React.Element | null
Rendered at the top of each section.
Rendered at the bottom of each section.
(item: ItemT, index: number) => string
Used to extract a unique key for a given item at the specified index. Key is used for caching and as the react key to track item re-ordering.
React.ComponentType
Rendered in between each item, but not at the top or bottom of each section.
React.ComponentType
Rendered at the top and bottom of each section.
React.ComponentType | React.Element
Rendered at the very beginning of the list.
Rendered at the very end of the list.
React.ComponentType | React.Element
Rendered when the list is empty.
any
A marker property for telling the list to re-render (since it implements
PureComponent).number
How many items to render in the initial batch. This should be enough to fill the screen but not much more.
boolean
Reverses the direction of scroll. Uses scale transforms of -1.
(info: {distanceFromEnd: number}) => void
Called once when the scroll position gets within
onEndReachedThreshold of the rendered content.() => void
If provided, a standard RefreshControl will be added for “Pull to Refresh” functionality.
boolean
Set this true while waiting for new data from a refresh.
boolean
This may improve scroll performance for large lists.
boolean
Makes section headers stick to the top of the screen until the next one pushes it up. Only enabled by default on iOS.
Methods
scrollToLocation()
sectionIndex and itemIndex positioned in the viewable area.
recordInteraction()
flashScrollIndicators()
Section Structure
Each section in thesections array should have the following structure:
Performance Tips
- Implement
getItemLayoutfor better scrolling performance - Use
keyExtractorto provide stable unique keys - Pass
extraDataif yourrenderItemdepends on external data - Consider using
removeClippedSubviewsfor very long lists