1.0.1 • Published 2 years ago

rn-weblineindia-expandable-flatlist v1.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
2 years ago

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

$ 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

PropsTypeRequiredDescription
dataarrayYesArray List to be displayed.
numberOfLinesnumberOptionalNumber of lines to be displayed after that it will show option of Show more.
titleKeystringOptionalKey which is used for title in the list.
subTitleKeystringOptionalKey which is used for subTitle in the list.
descriptionKeystringOptionalKey which is used for description in the list.
dateKeystringOptionalKey which is used for date in the list.
viewStyle[object, array]OptionalStyles is passed to the View for single item of flatlist.
titleStyle[object, array]OptionalStyles is passed to the title.
subTitleStyle[object, array]OptionalStyles is passed to the sub title.
textStyle[object, array]OptionalStyles is passed to text(description)
dateStyle[object, array]OptionalStyles is passed to the date.
color[object, array]OptionalColor to be displayed for `MoreandLess`.

Methods

MethodsDescription
renderViewMoreRender view-more component.
renderViewLessRender 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

MIT

Keywords

rn-weblineindia-expandable-flatlist, react-native-expandable-flatlist, expandable-flatlist, expandable, collapse, viewmore, viewless, react-native