# View.Action.showPopup
Displays a custom Popup window, the content of the window is rendered by the page specified by contributions.popup [key] of app.json , and this method is called asynchronously.

## Availability description

Permission requirements | View Available Description | Platform is available | scene
---|---|---|---
Readable | Body block | PC | Presentation mode

## Input

| **Name** | **Data type** | **Is required** | **Description**                                                                                     |
| -------- | ------------- | --------------- | --------------------------------------------------------------------------------------------------- |
| key      | string        | No              | Specify the popup page to render, this key needs to be declared in the contributs.popup of app.json |
| style    | CSSProperties | No              | Popup container style                                                                               |
| data     | any           | No              | Pass data, Popup page can be obtained through DocMiniApp. Bridge.getInitData                        |

## Output

| **Name** | **Data type**                 | **Is required** | **Description**                                                                                                                                                                                                                                                                                                 |
| -------- | ----------------------------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| source   | 'user-action' \| 'api-invoke' | No              | Is the source of popup closure closed by the user or the developer call interface?<br>[User close] refers to the user clicking on the blank to automatically close Popup.<br>[Developer call interface closed] refers to the developer calling the DocMiniApp. View. Action.hidePopup interface in the popup |
| data     | any                           | Yes             | The data of the callback after popup is closed, pointing to the parameter passed by the developer to call hidePopup. If source is user-action, then data will be null.                                                                                                                                          |

## Example code

### Calling example

```js
const DocMiniApp = new BlockitClient().initAPI();
const result = await DocMiniApp.View.Action.showPopup({
  style: {
    left: 0,
    top: 0,
    width: '100vw',
    height: '100vh',
    background: 'rgba(0,0,0,0.55)',
  }
});
```

### Return example

```json
{
    "source": "user-action",
    "data": null
}
```