# Button

You may add a button at the and of your form in order to trigger a custom action. This component supports the following attributes:

<table><thead><tr><th width="155.33333333333331">Property</th><th width="264">Description</th><th>Values</th></tr></thead><tbody><tr><td>type</td><td>The type of button.</td><td><ul><li><code>primary</code>: Default blue button</li><li><code>success</code>: Green button</li><li><code>warning</code>: Orange button</li><li><code>danger</code>: Red button</li><li><code>muted</code>: Gray button</li></ul></td></tr><tr><td>click</td><td>A user-defined label that serves as a unique ID to link the button to an action. </td><td>Any user-defined label that matches the label of any of the supported actions.</td></tr></tbody></table>

## Supported button actions

Available actions inside the custom UI widget are:

* **Trigger webhook**: Upon clicking the button, an HTTP request will be made to the configured URL.
* **Go to dashboard**: Upon clicking the button, the configured dashboard will be launched in a new tab.
* **Go to URL**: Upon clicking the button, a new tab will be launched pointing to the designated URL.

## Example

The following code snippet displays a green button, that, upon being clicked, will launch the action labeled `make_request`, that will ultimately make an HTTP POST request to a certain configured Ubidots endpoint:

```xml
<button type="success" click="make_request">Send</button>
```

Here, the button's property `click` defines the label of the action to be performed ("make\_request") and which is configured in the widget's settings at the "actions" section:

<figure><img src="https://884329393-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhzNRg0B4ECiNXc093G%2Fuploads%2FBqBNGlSfwHOfArXae8BI%2Factions-custom-ui.gif?alt=media&#x26;token=1993a66f-e1bc-4715-98fd-c8d3bacb6742" alt=""><figcaption></figcaption></figure>

Note from the GIF above that, the **Label** field within the Widget's Action configuration, is filled with the same label as it was in the button's **click** property.


---

# 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://dev.ubidots.com/dashboards-and-widgets/custom-ui/button.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.
