> For the complete documentation index, see [llms.txt](https://docs.carto.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.carto.com/carto-for-developers/quickstart/create-your-first-widget.md). Agents can also search and read this documentation through its [MCP server](https://docs.carto.com/~gitbook/mcp).

# Create your first widget

As you've seen in [Key Concepts](https://docs.carto.com/carto-for-developers/key-concepts.md), CARTO can help you build fully-customizable, framework-agnostic charts and widgets that stay synchronized with your map, and offer advanced filtering abilities.

In the following [examples](https://docs.carto.com/carto-for-developers/examples.md) you will learn how to add these widgets to your map, and how a widget can filter the map and viceversa. There are multiple examples but here's our recommendation on where to start:

* Start with the [Formula widget](https://github.com/CartoDB/deck.gl-examples/tree/master/widgets-formula) example if you need a very basic understanding of how widgets in CARTO work.
* Go to the [Hello world with widgets example](https://github.com/CartoDB/deck.gl-examples/tree/master/hello-world-with-widgets) if you need a more complete example, with several widgets and filtering in and from the widgets.

Feel free to modify these examples to use your own data! Just remember to change the token in the `.env` file, as well as the `vectorTableSource` properties.

<figure><img src="https://3029946802-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FybPdpmLltPkzGFvz7m8A%2Fuploads%2Fgit-blob-a1968fa0ef0405e910c968a075c2a562ab86e8c5%2FScreenshot%202024-10-06%20at%2010.35.02.png?alt=media" alt=""><figcaption></figcaption></figure>


---

# 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://docs.carto.com/carto-for-developers/quickstart/create-your-first-widget.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.
