1.1.0 • Published 4 years ago

@freakycoder/react-native-input-bar v1.1.0

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

Battle Tested ✅

Fully customizable, beautifully designed Input Bar for React Native

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

Installation

Add the dependency:

npm i @freakycoder/react-native-input-bar

Peer Dependencies

IMPORTANT! You need install them
"react-native-spinkit": ">= 1.5.0",
"react-native-androw": ">= 0.0.34",
"@freakycoder/react-native-bounceable": "^0.2.0",

Note: Do not for get to pod install for installing properly SpinKit

Usage

InputBar should stay at the bottom therefore, please do not forget to set flex: 1 on your main container. Example is available for the real usage.

Import

import RNInputBar from "@freakycoder/react-native-input-bar";

Usage

<RNInputBar />

Auto-Grow InputBar Usage

All you need to do is set the multiline and set the height prop as null.

<RNInputBar multiline height={null} minHeight={50} />

Configuration - Props

PropertyTypeDefaultDescription
widthstring/number90% of screen widthchange the InputBar's width
heightstring/number50change the InputBar's height
bottomstring/number24change the InputBar's bottom position
valuestringundefinedset the TextInput's value
onChangeTextfunctionundefinedhandle onChangeText function
backgroundColorcolor#fdfdfdset your own color for InputBar's background color
textColorcolor#9da1abset your own color for TextInput's text color
shadowColorcolor#757575set your own color for TextInput's shadow color
placeholderstringType a message...change the TextInput's placeholder
textInputStylestyledefaultset your own style for TextInput
disableSendIconbooleanfalsedisable the send icon
disableSecondaryIconbooleanfalsedisable the secondary icon
onSendPressfunctionundefinedset a function when send icon is on pressed
secondaryIconOnPressfunctionundefinedset a function when secondary icon is on pressed
spinnerVisibilitybooleanfalsemake the spinner visible instead of primarty icon
spinnerTypestringFadingCircleAltchange the spinner type
spinnerSizenumber20change the spinner number
spinnerColorcolor#9da1abchange the spinner color
spinnerStylestyleundefinedset your own style for spinner
multilinebooleanfalseif you want auto-grow text RNInputBar then you need to use this prop & set the height prop to null !
minHeightstring/number50change the minimum height of the RNInputBar
maxHeightstring/numbernullchange the maximum height of the RNInputBar
borderRadiusnumber12change the border radius of the RNInputBar
sendIconImageSourceimagedefaultchange the send icon image
secondaryIconImageSourceimagedefaultchange the secondary icon image default is attachment

Roadmap

  • LICENSE
  • CHANGELOG
  • Auto-Grow Feature
  • TypeScript Challange
  • Optional Spinkit for secondary icon
  • Better Example

Credits

Thanks to Mayurksgr for this awesome inspiration. Credit Design Inpsiration

Author

FreakyCoder, kurayogun@gmail.com

License

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