# API

## <mercury-dialog>

An example element.

### Attributes

Name | Description | Type | Default
--- | --- | --- | ---
open | Whether the dialog should be open or not. | boolean | false
modal | Whether the dialog should be treated as a modal with a backdrop. | boolean | false
moveable | Whether the dialog should be moveable. | boolean | false
dock | The location in which the dialog should be docked. | string | 'none'
push | True if a docked dialog should push the page contents over rather than overlaying. | boolean | false
dockable | The location in which the dialog should be docked. | boolean | false
hide-close-button |  | boolean | false
backdropOpacity |  | number | 1
height |  | number | 400
width |  | number | 400
resizable | Whether or not the dialog is resizable. | boolean | false
title | The title shown in the dialog header when open. | string | ''

### Properties

Name | Attribute | Description | Type | Default
--- | --- | --- | --- | ---
open | open | Whether the dialog should be open or not. | boolean | false
modal | modal | Whether the dialog should be treated as a modal with a backdrop. | boolean | false
moveable | moveable | Whether the dialog should be moveable. | boolean | false
dock | dock | The location in which the dialog should be docked. | string | 'none'
push | push | True if a docked dialog should push the page contents over rather than overlaying. | boolean | false
dockable | dockable | The location in which the dialog should be docked. | boolean | false
hideCloseButton | hide-close-button |  | boolean | false
backdropOpacity | backdropOpacity |  | number | 1
returnValue |  |  | string | ''
height | height |  | number | 400
width | width |  | number | 400
resizable | resizable | Whether or not the dialog is resizable. | boolean | false
_dialogInteraction |  |  |  |
title | title | The title shown in the dialog header when open. | string | ''
_dialog |  |  | HTMLDialogElement |
_dragStartX |  |  | number | 0
_dragStartY |  |  | number | 0
_dragStartHeight |  |  | number | 0
_dragStartWidth |  |  | number | 0
_offsetTop |  |  | number | 0
_offsetLeft |  |  | number | 0
_resizeDirection |  |  |  |
_onDock |  |  |  |
_onUnDock |  |  |  |
_onDragMouseUp |  |  |  |
_onDragMouseMove |  |  |  |
_pushBody |  | Sets padding on the element for to compensate for any push enabled docked dialogs. |  |

### Methods

Name | Parameters | Description | Return
--- | --- | --- | ---
_getResizeDirection |  |  |
_handleClose |  | Mimic the HTMLDialogElement close event. |
_handleCancel |  | Mimic the HTMLDialogElement cancel event. |
showModal |  | showModal Shows the dialog as a modal with a background overlay. |
show |  | show Shows the dialog. |
close |  | close Closes the dialog. |
isDocked |  | isDocked True if docked. |

### Events

Name | Description
--- | ---
close |
cancel |
count-changed | Indicates when the count changes

### Slots

Name | Description
--- | ---
(default) | This element has a slot

### CSS Shadow Parts

Name | Description
--- | ---
button | The button