Utility
AI
Terminal
dialog-demo
No opentui live preview is registered for this example yet.
Installation
pnpm dlx shadcn@latest add @termcn/dialog
Usage
import { Dialog } from "@/components/ui/dialog";<Dialog
isOpen={true}
title="Save changes?"
onConfirm={() => save()}
onCancel={() => discard()}
>
<Text>You have unsaved changes. Would you like to save them?</Text>
</Dialog>API Reference
Dialog
| Prop | Type | Default |
|---|---|---|
title | string | undefined |
children | ReactNode | required |
confirmLabel | string | "OK" |
cancelLabel | string | "Cancel" |
onConfirm | () => void | undefined |
onCancel | () => void | undefined |
variant | "default" | "danger" | "default" |
isOpen | boolean | false |