Link Search Menu Expand Document

use-prompt

use-prompt is a React Hook that lets you conveniently display a component to a user asynchronously.

This allows you to ask a user for input, prompt for an answer, display a message, or do whatever you want in an asynchronous manner.

Features:

  • Use your own custom components
  • Promise-based (async/await and try/catch capable)
  • N-number of concurrent prompt support
  • Render anywhere you like for each prompt
  • Typescript support
  • Minimalistic, easy to use API
  • Very small bundle size

Installation

npm i use-prompt
yarn add use-prompt

Get started: Basic example


  1. API Details
  2. Typescript
  3. Examples

CI Coverage Status Codacy Badge

NPM Package Typescript Package size MIT License