Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

https://github.com/akshit5230/React-Native-Collapsible-Section

A collapsible section / section list with customizable section body and child body. Supports both iOS and Android.
https://github.com/akshit5230/React-Native-Collapsible-Section

Last synced: about 1 month ago
JSON representation

A collapsible section / section list with customizable section body and child body. Supports both iOS and Android.

Lists

README

        

# React-Native-Collapsible-Section
A collapsible section / section list with customizable section body and child body. Supports both iOS and Android.

## Installation

`npm i --save rn-collapsible-section`

## Usage

### 1. Minimal Example

```

This is header

}>

This is body

```

### 2. Full Example

```
import React from 'react';
import { View, Text } from 'react-native;
import CollapsibleSection from 'rn-collapsible-section';

export default class MyExample extends React.Component {

render() {
return (


This is header/collapsed section title

}
>

This is body seen when section is expanded



)
}

}

```

### 3. Flatlist Example (Usage as expandable section list)

```
import React from 'react';
import { View, Text, FlatList } from 'react-native;
import CollapsibleSection from 'rn-collapsible-section';

const favouriteMovies = [
'Mood of the Day',
'On your Wedding Day',
'Seducing Mr. Perfect',
'Whatcha wearing',
'Spell Bound',
'100 Days with Mr. Arrogant',
'Be with you',
'My Sassy Girl',
'200 Pounds Beauty',
'Cheese in Trap',
'Love 911'
]

export default class MyExample extends React.Component {

render() {
return (

{this.renderExpandableList()}

)
}

renderExpandableList() {
return(
(
this.renderCollapsibleItem(item)
)
/>
)
}

renderCollapsibleItem(item) {
return (

{item}

}
>

Details about the movie...


)
}

}

```

## Props
| Name | Usage | Example Value |
| --- | --- | --- |
| header | define the header / collapsed view / default view of the expandable view. On press expand or collapse | |

Thanks!