0.0.1 • Published 5 years ago

react-native-animated-searchbox v0.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

React Native - Animated Searchbox

A simple search box with animation. Compatible with Expo CLI and React Native CLI.

  • Easy to use,
  • Lightweight, fast, flexible and easy customizable,
  • Support both IOS & Android Devices,
  • Also Support React Native Web

Install

We used a search SVG icon in this project.
So, you need to install the React Native SVG library before continue the installation.

After that;

npm install react-native-animated-searchbox --save  
  
//or  
  
yarn add react-native-animated-searchbox  

Demo

SNACK EXPO IO

https://snack.expo.io/@gurayyarar/react-native---animated-searchbox

EXPO APP ON ANDROID

IOS

AS GIF (FOR QUICK CHECK)

IOSANDROIDWEB
IOSANDROIDWEB

Usage

//Call for the open  
openSearchBox = () => this.refSearchBox.open();  
  
//Call for the close  
closeSearchBox = () => this.refSearchBox.close();  
  
render() {  
 return ( 
    <View>
  
        <ReactNativeAnimatedSearchbox 
            ref={(ref) => this.refSearchBox = ref} 
            placeholder={"Search..."} 
        />
         
    </View>  
 )}  
  

Properties

KeyDescriptionValue TypeIs RequiredDefault
heightHeight of the search boxnumberfalse48
borderRadiusBorder radius of the search boxnumberfalse48
fontSizeFont size of the search boxnumberfalse20
backgroundColorBackground color of the search boxcolor codes (hex,rgb,rgba)falsergba(255,255,255,0.70)
placeholderTextColorPlaceholder text colorcolor codes (hex,rgb,rgba)false#555555
searchIconSizeSearch icon width and height sizenumberfalse20
searchIconColorSearch icon colorcolor codes (hex,rgb,rgba)false#555555
focusAfterOpenedIf true, keyboard will show after search box openedbooleanfalsefalse
shadowColorBox-shadow color of the search box. If you don't want to please type transparentcolor codes (hex,rgb,rgba)falsergba(0,0,0,0.12)
placeholderPlaceholder text of the search boxstring/texttrue
animationSpeedAnimation speeds as milisecondsarray ([number, number])false200, 250

And also supporting props all of the TextInput Component of React Native.

Events

KeyDescription
onOpeningTrigger on search box start to open
onClosingTrigger on search box start to close
onOpenedTrigger on search box fully opened
onClosedTrigger on search box fully closed

And also supporting events all of the TextInput Component of React Native.

FAQ

Can I use this template for personal or commercial websites/web projects? Sure, you can use both of personal and commercial websites/web projects.

Is the attribution link required? No, not required. (Though very much appreciated)

License

React Native - Animated Searhbox is an open source project that is licensed under the MIT license.

Credits

  • Unsplash - Beautiful, free images and photos that you can download and use for any project.
  • Ionicons - Premium designed icons for use in web, iOS, Android, and desktop apps.

Donations

Donations are greatly appreciated!

BUY ME A COFFEE