0.1.2 • Published 3 years ago

react-native-search-header-box v0.1.2

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

Library Usage

Installation

Add the dependency:

npm i react-native-search-header-box

Peer Dependencies

"react-native-androw": ">= 0.0.34"

Usage

Import

import SearchHeaderBox from "react-native-search-header-box";

Fundamental Usage

<SearchHeaderBox />

Advanced Usage

<SearchHeaderBox
  headerText="Main Service"
  placeholder="Search Here.."
  rightButtonContainerStyle={{
    backgroundColor: "#50C479",
    borderRadius: 12,
    paddingLeft: 12,
    paddingRight: 12,
    paddingTop: 3,
    paddingBottom: 3,
    justifyContent: "center",
    alignItems: "center",
    width: 55,
    height: 30,
  }}
  rightButtonComponent={
    <Text style={{ color: "#fff", fontWeight: "700" }}>New</Text>
  }
  inputActiveBorderColor="#6AB786"
  inputBorderColor="#C9F6D9"
/>

Example Project 😍

You can checkout the example project 🥰

Simply run

  • npm i
  • react-native run-ios/android

should work of the example project.

Configuration - Props

Customization (Optionals)

PropertyTypeDefaultDescription
mainContainerStyleViewStyledefaultset or override the style object for the main container
leftIconComponentComponentImageset the content of the left button
headerTextstring''change the header title text
rightButtonComponentComponentImageset the content of the right button
rightButtonBackgroundColorstring'#F4F4F4'change the right button background color
headerTitleTextStyleTextStyledefaultset or override the style object for the header text
headerTitleTextComponentComponentTextset the header title
searchIconComponentComponentImageset the search icon component
textInputStyleTextStledefaultset or override the style object for search text input
bottomContainerStyleViewStyledefaultset the override the bottom container
leftButtonContainerStyleViewStyledefaultset or override the left button style
leftButtonBackgroundColorstring"#F4F4F4"change the left button background color
isVisibleLeftButtonbooleantruechange the left button visibility
isVisibleRightButtonbooleantruechange the right button visibility
isVisibleSearchbooleantruechange the search bar visibility
rightButtonContainerStyleViewStyledefaultset or override the right button style
searchBarShadowColorstring'#50C479'change the search bar shadow color
searchBarShadowStyleViewStyledefaultset or override the search bar shadow style
inputActiveBorderColorstring'#50C479'change the active input border color
inputBorderColorstring'#F4F4F4'change the input border color
leftButtonShadowStyleViewStyledefaultset or override the left button shadow style
leftButtonShadowColorstring'#F4F4F4'change the left button shadow color
rightButtonShadowColorViewStyledefaultset or override the right button shadow style
rightButtonShadowStylestring'#F4F4F4'change the right button shadow color
onLeftButtonPressFunctionundefinedset your own logic for the left button functionality when the left button is pressed
onRightButtonPressFunctionundefinedset your own logic for the right button functionality when the right button is pressed

You can use all of the TextInput props.

Future Plans

  • LICENSE

Author

Şevval Eygül sevvalleygull@gmail.com

License

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