# Dialog · JGuang UI

> A window overlaid on either the primary window or another dialog window, rendering the content underneath inert.

- Page: https://jiguang132.com/systems/jguang-ui/docs/components/radix/dialog
- Based on: shadcn/ui documentation (MIT) @ bc0705384b51252af26dcc65425b216bf5eb063c

> Example `dialog-demo`: interactive preview on https://jiguang132.com/systems/jguang-ui/docs/components/radix/dialog


## Installation


  

**Command**


  

**Manual**


```text
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
```


### Install the following dependencies:


```bash
npm install radix-ui
```


### Copy and paste the following code into your project.


[View complete source: components/ui/dialog.tsx](/r/jguang-ui/radix/dialog.json)


### Update the import paths to match your project setup.


## Usage

```tsx showLineNumbers
import {
  Dialog,
  DialogContent,
  DialogDescription,
  DialogHeader,
  DialogTitle,
  DialogTrigger,
} from "@/components/ui/dialog"
```

```tsx showLineNumbers
<Dialog>
  <DialogTrigger>Open</DialogTrigger>
  <DialogContent>
    <DialogHeader>
      <DialogTitle>Are you absolutely sure?</DialogTitle>
      <DialogDescription>
        This action cannot be undone. This will permanently delete your account
        and remove your data from our servers.
      </DialogDescription>
    </DialogHeader>
  </DialogContent>
</Dialog>
```

## Composition

Use the following composition to build a `Dialog`:

```text
Dialog
├── DialogTrigger
└── DialogContent
    ├── DialogHeader
    │   ├── DialogTitle
    │   └── DialogDescription
    └── DialogFooter
```

## Custom Close Button

Replace the default close control with your own button.


> Example `dialog-close-button`: interactive preview on https://jiguang132.com/systems/jguang-ui/docs/components/radix/dialog


## No Close Button

Use `showCloseButton={false}` to hide the close button.


> Example `dialog-no-close-button`: interactive preview on https://jiguang132.com/systems/jguang-ui/docs/components/radix/dialog


## Sticky Footer

Keep actions visible while the content scrolls.


> Example `dialog-sticky-footer`: interactive preview on https://jiguang132.com/systems/jguang-ui/docs/components/radix/dialog


## Scrollable Content

Long content can scroll while the header stays in view.


> Example `dialog-scrollable-content`: interactive preview on https://jiguang132.com/systems/jguang-ui/docs/components/radix/dialog


## RTL

To enable RTL support in JGuang UI, see the [RTL configuration guide](/systems/jguang-ui/docs/rtl).


> Example `dialog-rtl`: interactive preview on https://jiguang132.com/systems/jguang-ui/docs/components/radix/dialog


## API Reference

See the [Radix UI](https://www.radix-ui.com/docs/primitives/components/dialog#api-reference) documentation for more information.

---

Index of all JGuang resources: https://jiguang132.com/llms.txt
