Skip to content

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

Notifications You must be signed in to change notification settings

sathishu37/react-native-expandable-view

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 

Repository files navigation

react-native-expandable-view

NPM Version NPM Downloads


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

npm install react-native-expandable-view --save
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

Prop Description Default
intialMaxHeight The maxmium height your content can be before it becomes expandable 500
text Text for the expand button 'Tap here to expand'
header When provided, the header component will always be shown and the child components will be hidden until expanded
buttonStyle Style object that will be applied to the button View

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 45.1%
  • Objective-C 32.4%
  • Python 12.1%
  • Java 10.4%