React Native CollapsingToolbar

Mon, Jan 22, 2018 One-minute read

React Native CollapsingToolbar

“Screen Shot 1” “Screen Shot 2”

Getting Started

$ npm i react-native-collapsingtoolbar

Usage

Import the component:

    import CollapsingToolbar from 'react-native-collapsingtoolbar';
    import Icon from 'react-native-vector-icons/Ionicons';

    <CollapsingToolbar 
        leftItem={<Icon name="md-menu" size={30} color="#fff" />}
        rightItem={<Icon name="md-create" size={30}  color="#fff" />}   
        toolbarColor='#2196f3'  
        title='Demo Toolbar'
        src={require('../../../images/drawer6.png')}>
        <Text>
            Create             
        </Text>
    </CollapsingToolbar>

Props

PropTypeDefaultdescription
srcobjectrequire(‘img.png’) or {uri: url}
titlestringHometoolbar title
titleColorstring#ffftoolbar title text color
toolbarColorstring#e91e63toolbar background color
toolbarMaxHeightnumber300maximum height of toolbar
toolbarMinHeightnumber55minimum height of toolbar
leftItemPropTypes.elementtoolbar left menu item
leftItemPressfunc
leftItemPropTypes.elementtoolbar right item
rightItemPressfunc