react-native-modal-prompt
A cross-platform prompt component for React Native.
Installation
$ npm install react-native-modal-prompt --save
Examples
Basic | Prompt showCount |
---|---|
Basic Usage
; <Prompt visible=thisstatepromptVisible title="title" placeholder="please write something" defaultValue="prompt" showCount=true operation= text: 'Cancel' color: '#000' { ToastAndroid; return false; } text: 'Ok' { console; // ajax.... ToastAndroid; ; } />
full examples here.
API
Props:
visible
(boolean) -- Control display or hidingtitle
(string, required) -- The title text of the promptplaceholder
(string) -- The placeholder text of the promptdefaultValue
(string) -- The default value of the promptoperation
(array, required) -- Multiple control buttons can be customized, and the 'onPress' function is callback of the button after click that can await something like ajax, if the return value is false, the prompt will not closemaxLength
(string) -- The maxLength can be input of the promptshowCount
(boolean) -- If this is true, the prompt will display word length of input