> 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

This element displays a button whose color reflects its status based on its type.

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="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&amp;token=1993a66f-e1bc-4715-98fd-c8d3bacb6742" 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
