React native prompt.
Component opens full screen prompt modal with input field.
Based on react native elements buttons and react native modal.
Demo:
Installation:
NPM installation.
npm install --save react-native-elements-prompt
Props:
Required props:
- visible: bool
- onSubmit: func( inputValue )
- onCancel: func()
Optional props:
- Full list of props, see in example. // TODO: add list of optional props to Readme.
Usage:
How to use it in a react-native component:
;;;; Component state = promptValue: '' showPrompt: false { this } { this } { this } { return <View> <Prompt visible=thisstateshowPrompt animationType='slide' title= text:'Input something' style: color:'grey' input= keyboardType:'numeric' placeholder:'some text' maxLength: 5 style: fontSize: 48 submitButton= text:'OK' color:'orange' cancelButton= text:'Cancel' color:'red' onSubmit= this_onPromptSubmit onCancel= this_hidePrompt /> <Button title='Show Prompt' onPress= this_showPrompt /> </View> }