Coder Social home page Coder Social logo

trendingtechnology / react-native-dynamic-search-bar Goto Github PK

View Code? Open in Web Editor NEW

This project forked from wrathchaos/react-native-dynamic-search-bar

0.0 2.0 0.0 26.59 MB

Fully customizable Dynamic Search Bar for React Native

Home Page: https://www.freakycoder.com

License: MIT License

JavaScript 69.75% Python 7.86% Java 6.64% Objective-C 15.75%

react-native-dynamic-search-bar's Introduction

React Native Dynamic Search Bar

Fully customizable Dynamic Search Bar for React Native.

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

React Native Dynamic Search Bar React Native Dynamic Search Bar

Installation

Add the dependency:

React Native:

npm i react-native-dynamic-search-bar

Peer Dependencies

IMPORTANT! You need install them.
"react": ">= 16.x.x",
"react-native": ">= 0.55.x",
"react-native-vector-icons": ">= 6,x,x",
"react-native-dynamic-vector-icons": ">= x,x,x"

Usage

There are two modes in the library:

  • Search Button
  • Search TextInput

Basic Usage

<SearchBar
  placeholder="Search here"
  onChangeText={text => {
    console.log(text)
  }}
  onPressCancel={() => {
    this.filterList("");
  }}
  onPress={() => alert("onPress")}
/>

Advanced Usage

You can check the example for the advanced usage

<SearchBar
  fontColor="#c6c6c6"
  iconColor="#c6c6c6"
  shadowColor="#282828"
  cancelIconColor="#c6c6c6"
  backgroundColor="#353d5e"
  placeholder="Search here"
  onChangeText={text => {
    this.filterList(text);
  }}
  onPressCancel={() => {
    this.filterList("");
  }}
  onPress={() => alert("onPress")}
/>

Configuration - Props

Property Type Default Description
onPress function function set your own function for the onPress functionality
fontSize number 13 change the font size
fontColor color #b3b6c3 change the font color
iconName string search change the icon
iconType string Octicons change the icon style
iconSize number 20 change the icon size
iconColor color #807DE7 change the icon color
iconComponent component Icon set your own component instead of Icon
shadowColor color #757575 change the shadow color
shadowStyle style shadow style set your own shadow style
placeholder string null set your own placeholder string
textInputDisable boolean false disable the text input, and Text component will be available instead
textInputComponent component Text OR TextInput set your own component instead of Text OR TextInput for the center component
textInputValue string value set the value of the text input
onChangeText function function set your own function for the onChangeText logic
cancelIconName string clear change the cancel icon
cancelIconType string MaterialIcons change the cancel icon style
cancelIconSize number 23 change the cancel icon size
cancelIconColor color #b3b6c3 change the cancel icon color
cancelIconComponent component Icon set your own component instead of Icon for the cancel component (right component)
onPressCancel function function set your own function for the cancel button's onPress functionality
cancelComponent component component set your own component instead of cancel component
cancelButtonDisable boolean false disable cancel button component

ToDos

  • LICENSE
  • Write an article about the lib on Medium

Author

FreakyCoder, [email protected]

License

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

react-native-dynamic-search-bar's People

Contributors

wrathchaos avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.