<!-- AUTO-GENERATED from the @riverty/web-components custom elements manifest. Do not edit by hand. -->

# r-dialog

A modal dialog overlay for displaying content or collecting user input. Traps focus while open and supports customizable header, body, and footer slots.

Example:
```
<r-dialog open headline="Confirm action">
  <p>Are you sure you want to proceed?</p>
  <div slot="footer">
    <r-button variant="primary">Confirm</r-button>
    <r-button variant="secondary">Cancel</r-button>
  </div>
</r-dialog>
```

## class: `RDialog`, `r-dialog`

### Fields

| Name             | Privacy | Type                             | Default    | Description                                                                                                                                                                                                                                                                        | Inherited From |
| ---------------- | ------- | -------------------------------- | ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------- |
| `bodyHeight`     |         | `string`                         | `'auto'`   | Allows to set height of the dialog body container <br>while the value is smaller then `max-height` of the <br>dialog body pre-set according to the `size` prop.                                                                                                                  |                |
| `bodyText`       |         | `string`                         |            | Allows plain text to be provided to the body of the dialog<br>in cases where markup is not required. For more complex cases,<br>including those requiring HTML markup, <br>use <div slot="body">...</div>.                                                                      |                |
| `closeAriaLabel` |         | `string`                         |            | Allows plain text to be provided to the close button of the dialog.                                                                                                                                                                                                                |                |
| `headline`       |         | `string`                         |            | Allows to provide headline text to the dialog header section.                                                                                                                                                                                                                      |                |
| `open`           |         | `boolean`                        | `false`    | Define if dialog either shown or hidden.                                                                                                                                                                                                                                           |                |
| `returnValue`    |         | `string`                         |            | A value indicating the result of a user’s <br>interaction with the dialog, used to determine what action <br>the user took before closing the dialog. <br><br>For example, it can differentiate between whether the user <br>clicked a “Confirm” button or a “Cancel” button. |                |
| `size`           |         | `"large" \| "medium" \| "small"` | `'medium'` | Defines one of pre-defined sizes of the dialog.                                                                                                                                                                                                                                    |                |

### Methods

| Name        | Privacy | Description                                                               | Parameters | Return          | Inherited From |
| ----------- | ------- | ------------------------------------------------------------------------- | ---------- | --------------- | -------------- |
| `close`     |         | Method to display a non-modal dialog                                      |            | `Promise<void>` |                |
| `showModal` |         | Method to display a modal dialog                                          |            | `Promise<void>` |                |
| `toggle`    |         | Method to either show or hide dialog <br>depending on the current state. |            | `Promise<void>` |                |

### Events

| Name    | Type               | Description                                                                       | Inherited From |
| ------- | ------------------ | --------------------------------------------------------------------------------- | -------------- |
| `close` | `CustomEvent<any>` | Emitted when the dialog is closed.<br>Fired by close(), and by the close button. |                |

### Attributes

| Name               | Field          | Inherited From |
| ------------------ | -------------- | -------------- |
| `body-height`      | bodyHeight     |                |
| `body-text`        | bodyText       |                |
| `close-aria-label` | closeAriaLabel |                |
| `headline`         | headline       |                |
| `open`             | open           |                |
| `return-value`     | returnValue    |                |
| `size`             | size           |                |

### Slots

| Name     | Description                                |
| -------- | ------------------------------------------ |
|          | Default slot for the dialog body content   |
| `footer` | Footer content (e.g. action buttons)       |
| `form`   | Form element placed inside the dialog body |
| `header` | Dialog header content                      |

<hr/>

## Exports

| Kind                        | Name       | Declaration | Module | Package |
| --------------------------- | ---------- | ----------- | ------ | ------- |
| `js`                        | `RDialog`  | RDialog     |        |         |
| `custom-element-definition` | `r-dialog` | RDialog     |        |         |
