Prompt Dialog Overview
Description
Pando’s Prompt Dialog is an standardized blocking UX used to interrupt the user’s task with important, critical, or warning information. This component displays a modal text control prompt with the given message, waits for the user to dismiss it, and returns the value that the user entered. This is the Pluralsight themed version of a browser’s native window.prompt()
function.
Prompt Dialog Anatomy
- Dialog Container
- Header (optional)
- Heading (optional)
- Body
- Label (hidden or visible)
- Input
- Footer
- Cancel Button
- Confirm Button
Basic Usage
Import
Hook usage
usePrompt
is a hook that provides the async function prompt
which takes the following object as an argument:
Note: those denoted with ?
are optional