# Dialog

> Alias of Modal, named after the shadcn convention.

- Category: [Overlays](https://tarve.dev/docs.md#overlays)
- Import: `import { Dialog } from "@tarve/core";`
- Source: [packages/core/src/components/modal.ts:128](https://github.com/omarcosr/tarve/blob/main/packages/core/src/components/modal.ts#L128)

## Usage

```tsx title="Dialog.tsx"
import { Button, Dialog, Text } from "@tarve/core";

let open = true;

<>
  <Button variant="outline" onClick={() => (open = true)}>
    About
  </Button>
  <Dialog
    open={open}
    title="About"
    width={420}
    onOpenChange={(next) => {
      open = next;
    }}
  >
    <Text>Built with Tarve.</Text>
  </Dialog>
</>
```

## Props

Dialog has no props of its own beyond the inherited and common props below.

### Inherited from `ModalProps`

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `open` (required) | `boolean` | — |  |
| `closeOnEscape` | `boolean` | — |  |
| `closeOnOverlay` | `boolean` | — |  |
| `description` | `string` | — |  |
| `footer` | `Child` | — |  |
| `onOpenChange` | `(open: boolean) => void` | — |  |
| `scrollBody` | `boolean` | — | The panel never grows past the window (24 px margins): title and footer stay put and the body scrolls (a `Scroll`). Default `true`; `false` lays the body out unbounded, as before. |
| `showClose` | `boolean` | — |  |
| `title` | `string` | — |  |
| `width` | `number` | — |  |

## Common props

Shared by every component (descriptions: https://tarve.dev/docs.md#common-props): `children`, `class`, `className`, `highlight`, `id`, `key`, `motionFrom`, `onHighlight`, `onPaste`, `onPointerLeave`, `onPointerMove`, `onSize`, `onTransitionEnd`, `rovingGroup`, `style`.

Previous: [Modal](https://tarve.dev/docs/components/Modal.md) · Next: [AlertDialog](https://tarve.dev/docs/components/AlertDialog.md)

---

Tarve v0.13.8 · HTML version: https://tarve.dev/docs/components/Dialog · Index for agents: https://tarve.dev/llms.txt
