> For the complete documentation index, see [llms.txt](https://partners.tray.com.br/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://partners.tray.com.br/themes/construindo-seu-template/editor-do-tema/novo/estrutura/componentes/toggle.md).

# Toggle

O componente do tipo <mark style="color:blue;">toggle</mark> deve ser utilizado quando o criador do tema disponibiliza ao usuário a possibilidade dele ativar ou desativar determinada função dentro do tema. Abaixo é possível visualizar a aparência deste campo.

<figure><img src="/files/RTfY9r7Mu2gRcoNIAXOh" alt=""><figcaption><p><strong>Exibição do campo toggle</strong></p></figcaption></figure>

<figure><img src="/files/d6qxEZ9eFjVcX9BWgpZ5" alt=""><figcaption><p><strong>Exibição do campo toggle ativo</strong></p></figcaption></figure>

**Estrutura padrão do campo:**

{% code overflow="wrap" %}

```json
{
    "label": "Título do campo toogle", 
    "type": "toggle", 
    "description": "Descrição do campo de toogle.",
    "field": "nome_do_campo_toogle"
}
```

{% endcode %}

<table><thead><tr><th width="228">Atributo</th><th>Descrição</th></tr></thead><tbody><tr><td>label</td><td>Título do campo</td></tr><tr><td>type</td><td>Tipo do campo</td></tr><tr><td>description</td><td>Descrição do campo <br>Caso não houver, deixar vazio</td></tr><tr><td>field</td><td>Campo utilizado no tema para exibir o item desejado. <br>Esse nome deve ser exatamente igual ao campo criado no tema</td></tr></tbody></table>

{% hint style="danger" %}
Para funcionar corretamente, o campo deve ter o valor booleano **true** ou **false**. Se o toggle estiver habilitado será **true** e se estiver desabilitado será **false**. Por exemplo: ***`field_name: true`***
{% endhint %}


---

# 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://partners.tray.com.br/themes/construindo-seu-template/editor-do-tema/novo/estrutura/componentes/toggle.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.
