React native module to add a button icon (with text or not)
$ npm install react-native-bm-header-action --save
$ react-native link react-native-bm-header-action
Start by adding
import BmHeaderAction from 'react-native-bm-header-action';
then use like this :
<BmHeaderAction style={styles.headerStyle}
title={this.props.title}
buttonStyle={styles.buttonStyle}
buttonIconStyle={styles.buttonIconStyle}
titleStyle={styles.titleStyle}
menuIcon={require("../icons/home.png")}
buttonAction={this.onClick}/>
Prop | Default | Type | Description | Optional |
---|---|---|---|---|
style | width: 100% |
style object |
Change the default style of the base button | yes |
title | - | string |
Add a title in the header | yes |
buttonStyle | - | style object |
Change the default style of action button | yes |
buttonIconStyle | - | style object |
Change the default style of the action icon | yes |
titleStyle | - | style object |
Change the default style of the title | yes |
menuIcon | - | icon like require('../myicon.png') or variable contain it |
Add the icon to the button | yes |
buttonAction | - | function |
Add a callback function to the button | yes |
Enjoy :)