A ReactNative collapsible list component
You can install this package via yarn
:
yarn add react-native-collapsible-list
or npm
npm install react-native-collapsible-list --save
import React, { Component } from 'react'
import { Text, View } from 'react-native'
import CollapsibleList from 'react-native-collapsible-list'
export default class App extends Component {
render () {
return (
<View style={styles.container}>
<CollapsibleList
numberOfVisibleItems={1}
items={[
<View style={styles.collapsibleItem}>
<Text>Hello Collapsable List :)</Text>
</View>,
<View style={styles.collapsibleItem}>
<Text>Collapsable List Item</Text>
</View>,
<View style={styles.collapsibleItem}>
<Text>Collapsable List Item</Text>
</View>
]}
/>
</View>
)
}
}
Prop | Default | Description |
---|---|---|
animationConfig | {} |
Standard config of timing animation |
buttonContent | <Text>Collapse Button</Text> |
Content of collapse button |
items | [] |
Your list items |
imageResizeMode | 'cover' |
ResizeMode of the stretchy header image. You can use one of these values |
numberOfVisibleItems | 1 |
Number of visible items when lis is not collapse |
wrapperStyle | {} |
The style of the list wrapper |
This project is a basic collapsible list and must be improve. You can fork the repository, improve or fix some part of it and then send the pull requests back if you want to see them here. I really appreciate that. 😉
Licensed under the GPL-2.0.