Utility
Terminal
█
dialog-demo █
Loading preview... █
█
█
█
█
█
█
█
█
█
█
█
█
█
█
█Installation
$ pnpm dlx shadcn@latest add @termcn/opentui/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 | - |
children | ReactNode | required |
confirmLabel | string | "OK" |
cancelLabel | string | "Cancel" |
onConfirm | () => void | - |
onCancel | () => void | - |
variant | "default" | "danger" | "default" |
isOpen | boolean | false |