0.2.1 • Published 4 years ago

react-native-gradient-header v0.2.1

Weekly downloads
32
License
MIT
Repository
github
Last release
4 years ago

Battle Tested ✅

Fully customizable and unique shape Gradient Header for React Native

npm version npm Platform - Android and iOS License: MIT

Installation

Add the dependency:

React Native:

npm i react-native-gradient-header

Peer Dependencies

IMPORTANT! You need install them.
"react": ">= 16.x.x",
"react-native": ">= 0.55.x",
"react-native-linear-gradient": ">= 2.5.6",
"@freakycoder/react-native-helpers": ">= 0.1.2",

Basic Usage

import GradientHeader from "react-native-gradient-header";

<GradientHeader />;

Advanced Usage

import GradientHeader from "react-native-gradient-header";

<GradientHeader
  title="Title"
  subtitle="Have a nice day Kuray"
  gradientColors={["#00416A", "#E4E5E6"]}
  imageSource={require("./assets/profile.jpg")}
/>;

Configuration - Props

PropertyTypeDefaultDescription
titlestringTodaychange the title
subtitlestringHave a nice daychange the subtitle
gradientbooleantrueif you do not want gradient background, simply make this prop false
gradientColorscolors"#12c2e9", "#c471ed", "#f64f59"change the gradient colors
startx,y{ x: 0, y: 0 }change the gradient's direction of start
endx,y{ x: 1, y: 0 }change the gradient's direction of end
shapeColorcolor#ba75dfchange solid background color, it is available when gradient prop is false
imageSourceimageprofile imagechange the circle image
imageOnPressfunctionnullset the onPress function for profile image
positionstyletopset the background shape's position
headerContentComponentcomponentchech the codeset your own design for the header content
shadowStylestyleshadowset your own shadow style instead of the implemented one
shadowColorcolor"#000"change the shadow color

ToDos

  • LICENSE
  • Expo Support (Coming Soon)
  • Write an article about the lib on Medium

Author

FreakyCoder, kurayogun@gmail.com

License

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