# Dialog

Focuses attention on a task or decision in a modal surface. Use it when the user must review or complete something before returning to the page.

Package: `@kela-systems/ui-components` 4.1.0

```tsx
import { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger } from "@kela-systems/ui-components";
```

Links (Kela sign-in needed): [Storybook](https://main--6af1efd9453270bb59a6c00c.chromatic.com/?path=/docs/components-dialog--docs), [Source](https://github.com/Kela-Systems/kela/tree/main/packages/next/ui-components/src/dialog), [Figma](https://www.figma.com/design/anhlwrbFM6mUiL0klxeK1I/ARK---Design-System?node-id=112-477)

## Examples

### Default

```tsx
import {
  Button,
  Dialog,
  DialogClose,
  DialogContent,
  DialogDescription,
  DialogFooter,
  DialogHeader,
  DialogTitle,
  DialogTrigger,
} from "@kela-systems/ui-components";

export default function DialogDefault() {
  return (
    <Dialog>
      <DialogTrigger render={<Button variant="outline" />}>Export clip</DialogTrigger>
      <DialogContent closeLabel="Close">
        <DialogHeader>
          <DialogTitle>Export clip</DialogTitle>
          <DialogDescription>
            Camera 4, north gate, from 14:02 to 14:05. The file is saved to the mission archive.
          </DialogDescription>
        </DialogHeader>
        <DialogFooter>
          <DialogClose render={<Button variant="outline" />}>Cancel</DialogClose>
          <DialogClose render={<Button />}>Export</DialogClose>
        </DialogFooter>
      </DialogContent>
    </Dialog>
  );
}
```

## Props

A `className` on a part adds layout only: placement, sizing and spacing. Pick a look with a variant.

### Dialog

Also takes the props of `@base-ui/react/dialog`.

### DialogClose

Also takes the props of `@base-ui/react/dialog`.

### DialogContent

| Variant | Values | Default |
| --- | --- | --- |
| `size` | `default`, `sm` | `default` |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `showCloseButton` | `boolean` | `true` |  |
| `closeLabel` | `string` | `Close` |  |

Also takes the props of `@base-ui/react/dialog`.

### DialogDescription

Also takes the props of `@base-ui/react/dialog`.

### DialogFooter

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `showCloseButton` | `boolean` | `false` |  |
| `closeLabel` | `string` | `Close` |  |

Also takes the attributes of the HTML element it renders.

### DialogHeader

Also takes the attributes of the HTML element it renders.

### DialogOverlay

Also takes the props of `@base-ui/react/dialog`.

### DialogPortal

Also takes the props of `@base-ui/react/dialog`.

### DialogTitle

Also takes the props of `@base-ui/react/dialog`.

### DialogTrigger

Also takes the props of `@base-ui/react/dialog`.

## Related

- [AlertDialog](https://ark.kela.design/product/components/alert-dialog.md)
- [Sheet](https://ark.kela.design/product/components/sheet.md)
- [Drawer](https://ark.kela.design/product/components/drawer.md)
