rn-weblineindia-expandable-flatlist
v1.0.1
Published
A lightweight node module to expand/collapse text of any item in the flatlist in React-Native.
Downloads
3
Maintainers
Readme
React Native Expandable Flatlist Component
A lightweight node module to expand and collapse text of any item in the flatlist in React Native.
Getting started
- Installation
- Supported versions
- Usage
- Props
- Methods
- Want to Contribute?
- Need Help?
- Collection of Components
- Changelog
- License
- Keywords
Installation
$ npm install rn-weblineindia-expandable-flatlist --save
Supported versions
ReactNative 0.60 - 0.63 is supported for v1.0.1 of this module.
Usage
import ExpandableFlatlist from 'rn-weblineindia-expandable-flatlist';
<ExpandableFlatlist
data={arrayList} // arrayList is a list which wants display
titleKey="title"
/>
Change Layout for More
and Less
button
renderViewLess = (onPress) => {
return (
<TouchableOpacity
onPress={onPress}
style={{
// Style for more button...
}}
>
<Text>"Lable text for button..."</Text>
</TouchableOpacity>
)
}
<ExpandableFlatlist
renderViewMore={this.renderViewMore}
/>
Props
| Props | Type | Required | Description |
|----------------|-------------------|--------------------|-------------------------------------------------------------------------------|
| data | array
| Yes | Array List to be displayed. |
| numberOfLines | number
| Optional | Number of lines to be displayed after that it will show option of Show more. |
| titleKey | string
| Optional | Key which is used for title in the list. |
| subTitleKey | string
| Optional | Key which is used for subTitle in the list. |
| descriptionKey | string
| Optional | Key which is used for description in the list. |
| dateKey | string
| Optional | Key which is used for date in the list. |
| viewStyle | [object, array]
| Optional | Styles is passed to the View for single item of flatlist. |
| titleStyle | [object, array]
| Optional | Styles is passed to the title. |
| subTitleStyle | [object, array]
| Optional | Styles is passed to the sub title. |
| textStyle | [object, array]
| Optional | Styles is passed to text(description) |
| dateStyle | [object, array]
| Optional | Styles is passed to the date. |
| color | [object, array]
| Optional | Color to be displayed for `Moreand
Less`. |
Methods
| Methods | Description | |----------------|-------------------------------| | renderViewMore | Render view-more component. | | renderViewLess | Render view-less component. |
Want to Contribute?
- Created something awesome, made this code better, added some functionality, or whatever (this is the hardest part).
- Fork it.
- Create new branch to contribute your changes.
- Commit all your changes to your branch.
- Submit a pull request.
Need Help?
We also provide a free, basic support for all users who want to use this ReactNative Expandable Flatlist component in their software project. In case you want to customize this Expandable Flatlist component to suit your development needs, then feel free to contact our ReactNative developers.
Collection of Components
We have built many other components and free resources for software development in various programming languages. Kindly click here to view our Free Resources for Software Development.
Changelog
Detailed changes for each release are documented in CHANGELOG.md.
License
Keywords
rn-weblineindia-expandable-flatlist, react-native-expandable-flatlist, expandable-flatlist, expandable, collapse, viewmore, viewless, react-native