# Button Block Addon (buttonBlockAddon)

The purpose of this block is to display interactive buttons in documents source block (interfaceDocumentsSourceBlock).

## Usage

As shown in the example below, buttonBlockAddon blocks should be placed inside interfaceDocumentsSourceBlock blocks.

<figure><img src="/files/HNZzv3hR27RJ2j15iuC5" alt=""><figcaption></figcaption></figure>

## Properties

<table><thead><tr><th>Property Name</th><th>Description</th><th width="243">Example</th><th>Status</th></tr></thead><tbody><tr><td>Button Name (<em>name</em>)</td><td>The label (name) of the button as displayed to the user</td><td>"Approve", "Reject"</td><td></td></tr><tr><td>UI Class (<em>uiClass</em>)</td><td>The UI class of the button</td><td>“btn-approve”, “btn-reject”, “btn-link”</td><td></td></tr><tr><td>hideWhenDiscontinued</td><td>Check if the button should be hidden when policy is discontinued</td><td>Checked/Unchecked</td><td></td></tr><tr><td>Dialog (<em>dialog)</em></td><td>Determines if a dialog should be opened after the button is clicked</td><td>true, false.</td><td></td></tr><tr><td>Dialog Options (<em>dialogOptions</em>)</td><td>Will be shown only if the Dialog setting is set to true.</td><td><ol start="1"><li>Dialog Title (<em>dialogOptions.dialogTitle</em>): The title of the dialog. Example: “Rejection”.</li><li>Dialog Description (<em>dialogOptions.dialogDescription</em>): The description of the dialog. Example: “Enter reject reason”.</li><li>Dialog Result Field Path (<em>dialogOptions.dialogResultFieldPath</em>): The field which will contain the result value from the dialog. Example: “option.comment”.</li></ol></td><td></td></tr></tbody></table>

<figure><img src="/files/nuCjLgX6kGbybQWYngp5" alt=""><figcaption></figcaption></figure>

## Events

Button block addon events will be automatically added to document source.

<figure><img src="/files/3cgCsptFT96YyzihFCIN" alt=""><figcaption></figcaption></figure>

## API

The API for the buttonBlockAddon features both GET and POST methods:

1. Example response to the GET request:

```
{
    "id": "4e43f63f-f2e9-4336-a69e-931ec4aafaee",
    "blockType": "buttonBlockAddon",
    "dialog": true,
    "dialogOptions": {
        "dialogTitle": "Reject",
        "dialogDescription": "Enter reject reason",
        "dialogResultFieldPath": "option.comment"
    },
    "name": "Reject",
    "uiClass": "btn-reject",
}

```

The response to the GET request includes all block settings.

2. Example payload for the POST request:

```
{
  "documentId": "66b2838927c34db3c18e3c49",
  "dialogResult": "Typo in name"
}

```

Where

documentId - selected document identifier.

dialogResult is used for the dialog only.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://guardian.hedera.com/guardian-dev/guardian/standard-registry/policies/policy-creation/introduction/button-block-addon-buttonblockaddon.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
