0.1.7 • Published 3 years ago

react-native-classic-header v0.1.7

Weekly downloads
59
License
MIT
Repository
github
Last release
3 years ago

Battle Tested ✅

React Native Classic Header

npm version npm Platform - Android and iOS License: MIT styled with prettier

Installation

Add the dependency:

npm i react-native-classic-header

Peer Dependencies

"react": ">= 16.x.x",
"react-native": ">= 0.55.x",
"react-native-vector-icons": ">= 7.0.0",
"react-native-dynamic-vector-icons": ">= 1.0.0",
"@freakycoder/react-native-helpers": ">= 1.0.0"

Usage

Import

import ClassicHeader from "react-native-classic-header";

Classic Header Usage

Basic Usage

<ClassicHeader
  headerTitle="Header"
  rightComponentDisable
  leftComponentOnPress={() => {}}
  hitSlops={
    top: 30,
    bottom: 30,
    left: 30,
    right: 30
  }
/>

Advanced Custom Usage

<ClassicHeader
  headerTitle="Header"
  leftComponent={
    <TouchableOpacity onPress={() => {}}>
      <Icon name="ios-arrow-back" type="Ionicons" size={30} color="blue" />
    </TouchableOpacity>
  }
  rightComponent={
    <TouchableOpacity onPress={() => {}}>
      <Icon name="github" type="AntDesign" size={30} color="purple" />
    </TouchableOpacity>
  }
/>

Configuration - Props

Classic Header Props

PropertyTypeDefaultDescription
stylesstylesstylesuse this to change main style of the header
heightnumber50use this to change the header's height
widthnumber100%use this to change the header's width
statusBarHiddenbooleanfalseuse this to let Header Component itself re-arrange depends on the status bar
hitSlopsobjectobject: 30use this to change the header's left and right components' hitSlots
bottomStickbooleanfalsestick the header to bottom side
headerTitlestring""use this to set header's title
backgroundColorcolor#ffffffuse this to change the header's background color
leftComponentcomponentIconset the left component
leftComponentStylestylestyleset the left component's style
leftComponentDisablebooleanfalsedisable the left component
leftComponentOnPressfunctionnullset the left component's onPress function
rightComponentcomponentIconset the right component
rightComponentStylestylestyleset the right component's style
rightComponentDisablebooleanfalsedisable the right component
rightComponentOnPressfunctionnullset the right component's onPress function
centerComponentcomponentIconset the center component
centerComponentStylestylestyleset the center component's style

Future Plans

  • LICENSE

Author

FreakyCoder, kurayogun@gmail.com

License

React Native Classic Header is available under the MIT license. See the LICENSE file for more info.