react-native-simple-prompt

1.0.1 • Public • Published

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 />

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>
  </>
);

Package Sidebar

Install

npm i react-native-simple-prompt

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

526 kB

Total Files

67

Last publish

Collaborators

  • newbiebr