# react-native-single-prompt

> React native prompt component

Latest version **2.0.1** (published 2022-06-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-native-single-prompt
pnpm add react-native-single-prompt
yarn add react-native-single-prompt
bun add react-native-single-prompt
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.1 |
| Published | 2022-06-28 |
| First published | 2022-06-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 23.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Kamil Dike |
| Maintainers | kamildike |
| Keywords | react-native-prompt, react-native-single-prompt, component, prompt |

## Links

- npm: https://www.npmjs.com/package/react-native-single-prompt
- Repository: https://github.com/KamilDike/React-native-single-prompt
- Homepage: https://github.com/KamilDike/React-native-single-prompt#readme
- Issues: https://github.com/KamilDike/React-native-single-prompt/issues
- npm.io page: https://npm.io/package/react-native-single-prompt

## Alternatives

- [localforage](https://npm.io/package/localforage.md) — 6.2M weekly downloads
- [localforage-observable](https://npm.io/package/localforage-observable.md) — 30.8K weekly downloads
- [@y/y](https://npm.io/package/@y/y.md) — 30.1K weekly downloads
- [@metaobjectsdev/render](https://npm.io/package/@metaobjectsdev/render.md) — 3.5K weekly downloads
- [@ledgerhq/coin-algorand](https://npm.io/package/@ledgerhq/coin-algorand.md) — 1.1K weekly downloads

## Recent versions

- 2.0.1 (latest) — 2022-06-28
- 2.0.0 — 2022-06-25
- 1.0.2 — 2022-06-11
- 1.0.1 — 2022-06-11
- 1.0.0 — 2022-06-11
- 0.10.0 — 2022-06-11
- 0.9.0 — 2022-06-10

## README

# React-native-single-prompt

[![badge](https://upload.wikimedia.org/wikipedia/commons/thumb/d/db/Npm-logo.svg/100px-Npm-logo.svg.png)](https://www.npmjs.com/package/react-native-single-prompt)

Prompt component with single input field

```
import Prompt from 'react-native-single-prompt';
```

<p float="left">
<img width="298" alt="image" src="https://user-images.githubusercontent.com/40762724/173159583-09aba265-8973-4a86-a1e3-278b5ad480a5.png">
<img width="298" alt="image" src="https://user-images.githubusercontent.com/40762724/173159176-6e44bb35-0c3c-4708-ad1a-13be5b85aaf1.png">
</p>

![Simulator Screen Recording - iPhone 13 - 2022-06-11 at 08 42 46](https://user-images.githubusercontent.com/40762724/173176817-f32165d1-c668-4afc-ae64-e3e9775e7931.gif)
![Simulator Screen Recording - iPhone 13 - 2022-06-11 at 11 32 20](https://user-images.githubusercontent.com/40762724/173182389-2fc87d29-50cc-47b1-a5ba-39828ee5f169.gif)

Usage

1. <b>Installation</b>

```
yarn add react-native-single-prompt
```

or

```
npm i react-native-single-prompt
```

2. <b>Code sample</b><br>
   I highely advise controlling prompt with <b>Modal</b> from core react-native API

```
import Prompt from 'react-native-single-prompt';
import {Modal} from 'react-native';

const App = () => {
  const [isPromptActive, setIsPromptActive] = useState(false);

  return (
    <SafeAreaView style={{flex: 1}}>
      <Modal transparent={true} visible={isPromptActive} animationType="fade">
        <Prompt
          exit={() => setIsPromptActive(false)}
          callback={value => Alert.alert('Prompt confirmed', value)}
          name="iOS"
        />
      </Modal>
      <Button title="Activate prompt" onPress={() => setIsPromptActive(true)} />
    </SafeAreaView>
  );
};
```

3. <b>Optional props</b><br/>
   **backgroundOpacity**={value: number}, value in range: **<0;1>**, default = **0.5**

---
_Source: https://npm.io/package/react-native-single-prompt · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
