www/apps/ui/app/components/prompt/page.mdx
import { ComponentExample } from "@/components/ComponentExample" import { ComponentReference } from "@/components/ComponentReference"
export const metadata = {
title: Prompt,
}
A component that displays a dialog prompting the user for their approval. It's useful when confirming destructive actions.
<Note>This component is useful if you want to control the prompt's content, format, and design. For a simpler approach that follows Medusa's prompt format, refer to the usePrompt hook.
</Note>In this guide, you'll learn how to use the Prompt component.
<ComponentExample name="prompt-demo" />import { Prompt } from "@medusajs/ui"
<Prompt>
<Prompt.Trigger>Trigger</Prompt.Trigger>
<Prompt.Content>
<Prompt.Header>
<Prompt.Title>Title</Prompt.Title>
<Prompt.Description>Description</Prompt.Description>
</Prompt.Header>
<Prompt.Footer>
<Prompt.Cancel>Cancel</Prompt.Cancel>
<Prompt.Action>Delete</Prompt.Action>
</Prompt.Footer>
</Prompt.Content>
</Prompt>
<ComponentReference mainComponent="Prompt" componentsToShow={[ "Prompt", "Prompt.Header", "Prompt.Footer" ]} />
The confirmation variant is useful when confirming an operation that isn't destructive, such as deleting an item.