0.1.6 • Published 6 years ago

react-native-expandable-view v0.1.6

Weekly downloads
18
License
MIT
Repository
github
Last release
6 years ago

react-native-expandable-view

An expandable view for react native, working both on Android and iOS.

Installation

npm install react-native-expandable-view --save

Usage

import ExpandableView from 'react-native-expandable-view';

Then wrap the view you wish to be expandable.

It will automatically become expandable if the height of its content exceeds the given initial maximum height.

<ExpandableView>
    <View>
        <Text>My expandable view</Text>
    </View>
</ExpandableView>

Alernatively, you can render content using the header prop.

When providing this prop, all content in the header will be rendered. The content wrapped by the ExpandableView will be hidden, regardless of whether it exceeds the initial maximum height.

<ExpandableView
    header={this.renderHeader()}
>
    <View>
        <Text>My expandable view</Text>
    </View>
</ExpandableView>

Properties

PropDescriptionDefault
intialMaxHeightThe maxmium height your content can be before it becomes expandable500
textText for the expand button'Tap here to expand'
headerWhen provided, the header component will always be shown and the child components will be hidden until expanded
buttonStyleStyle object that will be applied to the button View
0.1.6

6 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago

0.0.3

7 years ago

0.0.1

7 years ago