> 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/html-canvas.md).

# HTML Canvas

Build your own custom widgets with the HTML Canvas

### Introduction:

Ubidots offers off-the-shelf widgets for most visualization needs. However, some projects require more specific or fully custom widgets. For those cases, use the HTML Canvas widget to build custom visualizations with your own code.

### Definition:

HTML Canvas is a widget for building custom widgets. It lets you write custom code with the following languages, along with Ubidots built-in methods and third-party libraries described later:

* HTML
* CSS
* JavaScript

This widget features a code editor composed of three tabs, one for each language.

### When to use the HTML Canvas?

Use HTML Canvas when other widgets do not meet your functionality or styling requirements.

### How to create an HTML Canvas?

Go to a dashboard, click the *Add new widget* button (+), scroll to the *Advanced* section, and select *HTML Canvas*.

<figure><img src="https://884329393-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhzNRg0B4ECiNXc093G%2Fuploads%2FFbgDbzmphSKNGbg8OaYF%2Fimage.png?alt=media&amp;token=6f355a93-83e4-49c7-b1e9-a7474e4a762d" alt="" width="375"><figcaption></figcaption></figure>

### Widget settings:

The widget offers the following settings:

* Code editor
* Third-party libraries
* Enable lazy loading
* Preload dashboard data

### Widget appearance tab:

The appearance of the widget can be customized further with these options:

* Name
* Custom Style

### Custom Style:

See [**Custom Style**](/dashboards-and-widgets/custom-ui.md) to learn how to customize your HTML Canvas styles.


---

# 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 following URL with the `ask` and `goal` query parameters:

```
GET https://dev.ubidots.com/dashboards-and-widgets/html-canvas.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 `build a script that syncs our docs to a CMS` 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.
