1.0.1 • Published 5 years ago

react-native-simple-prompt v1.0.1

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

React Native Simple Prompt

A super simple-to-use prompt for iOS and Android for lazy developers.

It almost has the same behavior as the AlertIOS.prompt but with cross-platform feature.

Usage

import Prompt from 'react-native-simple-prompt';

<TouchableOpacity
    onPress={() => {
        Prompt.show('Sign In', 'Enter your email', email =>
            console.log(`You entered ${email}`),
        );
    }}
/>
<Prompt />

npm.io

Quick Example

import React from 'react';
import {TouchableOpacity, Text} from 'react-native';
import Prompt from 'react-native-simple-prompt';

const App = () => (
  <>
    <TouchableOpacity
      onPress={() => {
        Prompt.show('Sign In', 'Enter your email', password =>
          console.warn(`You entered ${password}`),
        );
      }}
      style={{flex: 1, alignItems: 'center', justifyContent: 'center'}}>
      <Text>Sign In</Text>
    </TouchableOpacity>
    <Prompt></Prompt>
  </>
);