0.1.10 • Published 4 years ago

react-native-header-search-bar v0.1.10

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

Battle Tested ✅

Fully customizable header search bar for React Native

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

Installation

Add the dependency:

React Native:

npm i react-native-header-search-bar

Peer Dependencies

IMPORTANT! You need install them.
"react": ">= 16.x.x",
"react-native": ">= 0.55.x",
"react-native-androw": ">= 0.0.33",
"react-native-vector-icons": ">= 6.6.0",
"react-native-safe-area-context": ">= 0.6.1",
"react-native-dynamic-vector-icons": ">= 0.2.1",
"@freakycoder/react-native-helpers": ">= 0.0.21"

Component Options

  • HeaderSearchBar
  • HeaderClassicSearchBar

Import

import {
  HeaderSearchBar,
  HeaderClassicSearchBar
} from "react-native-header-search-bar";

HeaderSearchBar Usage

<HeaderSearchBar onChangeText={text => console.log(text)} />

HeaderClassicSearchBar Usage

<HeaderClassicSearchBar onChangeText={text => console.log(text)} />

Configuration - Props

Main Props

PropertyTypeDefaultDescription
backgroundColorcolor#fffchange the background color
shadowColorcolor#000change the main shadow color
firstTitlestringFind yourset the first title itself
secondTitlestringFavorite Art Workset the second title itself
firstTitleColorcolor#959597change the first title's text color
secondTitleColorcolor#34343bchange the second title's text color
firstTitleFontSizenumber18change the first title font size
secondTitleFontSizenumber18change the second title font size
iconComponentcomponenthamburger iconset your own component instead of hamburger icon component
onPressHamburgerIconfunctionnullset your own function when hamburger icon is on pressed

SearchBox Props

PropertyTypeDefaultDescription
iconNamestringsearchset the icon name
iconTypestringEvilIconsset the icon type
iconSizenumber25set the icon size
iconColorcolor#000set the icon color
onChangeTextfunctionfunctionset your own logic for changing text
valuestringundefinedset the value for search box's text input
searchBoxTextstringWhat are you looking for?set the search box's text
searchBoxTextStylestyledefaultset your own style for text input's style
searchBoxOnPressfunctionfunctionset your own logic when tapping the search box itself
searchBoxWidthnumber95%change the search box's width
searchBoxBorderRadiusnumber8change the search box's border radius
searchBoxBackgroundColorcolor#f5f5f5change the search box's background color
iconComponentcomponentIconset your own icon component instead of Icon
disableTextInputbooleanfalsedisable or enable the text input itself

Future Plans

  • LICENSE
  • Header Classic Search Bar Component
  • Write an article about the lib on Medium

Inspiration

Header Search Bar Component is designed by: Jawadur Rahman

Author

FreakyCoder, kurayogun@gmail.com

License

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