* added tool to generate spec files for React components * use typedoc for missing descriptions and types * improvements and fixes * improvements * added doc comments for half of the components * add custom resolver + more doc comments * added all tsdocs * general improvements * add specs to UI docs * added github action * remove unnecessary api route * Added readme for react-docs-generator * remove comment * Update packages/design-system/ui/src/components/currency-input/currency-input.tsx Co-authored-by: Kasper Fabricius Kristensen <45367945+kasperkristensen@users.noreply.github.com> * remove description of aria fields + add generate script --------- Co-authored-by: Kasper Fabricius Kristensen <45367945+kasperkristensen@users.noreply.github.com>
54 lines
729 B
Plaintext
54 lines
729 B
Plaintext
---
|
|
title: "usePrompt"
|
|
description: ""
|
|
component: true
|
|
---
|
|
|
|
This hook can be used to prompt the user for confirmation of an action.
|
|
|
|
## Usage
|
|
|
|
---
|
|
|
|
```tsx
|
|
import { usePrompt } from "@medusajs/ui"
|
|
```
|
|
|
|
```tsx
|
|
const dialog = usePrompt()
|
|
const actionFunction = async () => {
|
|
const confirmed = await dialog({
|
|
title: "Are you sure?",
|
|
description: "Please confirm this action",
|
|
})
|
|
}
|
|
```
|
|
|
|
## API Reference
|
|
|
|
---
|
|
|
|
### Call Signature
|
|
|
|
`usePrompt()`
|
|
|
|
### usePrompt return
|
|
|
|
<HookValues hook="usePrompt" />
|
|
|
|
### UsePromptProps
|
|
|
|
<ComponentReference mainComponent="RenderPrompt" />
|
|
|
|
## Examples
|
|
|
|
---
|
|
|
|
### Basic
|
|
|
|
<ComponentExample name="use-prompt-demo" />
|
|
|
|
### With Verification
|
|
|
|
<ComponentExample name="use-prompt-verification" />
|