> For the complete documentation index, see [llms.txt](https://dev.ubidots.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dev.ubidots.com/dashboards-and-widgets/custom-ui/button.md).

# Button

You can add a button at the end of your form 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 button type.</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 acts as a unique ID to link the button to an action.</td><td>Any user-defined label that matches the label of one of the supported actions.</td></tr></tbody></table>

## Supported button actions

Available actions inside the Custom UI widget are:

* **Trigger webhook**: When the button is clicked, an HTTP request is sent to the configured URL.
* **Go to dashboard**: When the button is clicked, the configured dashboard opens in a new tab.
* **Go to URL**: When the button is clicked, the configured URL opens in a new tab.

## Example

The following snippet displays a green button that, when clicked, runs the action labeled `make_request`, which sends an HTTP POST request to a configured Ubidots endpoint:

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

Here, the button's `click` property defines the label of the action to perform, `make_request`. Configure the same label in the widget settings under the **Actions** section:

<figure><img src="/files/nT01bLs8NSWuxNYgPcvP" alt="" width="563"><figcaption></figcaption></figure>

In the GIF above, the **Label** field in the widget's action configuration uses the same value as the button's `click` property.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://dev.ubidots.com/dashboards-and-widgets/custom-ui/button.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
