# Boolean

A simple on/off or true/false input, displayed as a switch in the **Email Editor**.

Works great for:

* **Show/hide** specific elements, i.e. making a CTA button optional.
* **Toggle direction**, i.e. in a component showing an image on the left, and a text on the right, you can make a toggle to allow the marketeer to switch the direction, so text shows on the left and image on the right.

### Template Editor

<div align="left"><figure><img src="https://4158541773-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUZwvCYi7VuSyayWGoc6M%2Fuploads%2F6iXPC7A4PieafytJ8IUj%2FSk%C3%A6rmbillede%202023-10-04%20162847.png?alt=media&#x26;token=3ed18b29-17fd-4c46-b01c-e36318f87aab" alt=""><figcaption><p>This is how it looks in the Template Editor</p></figcaption></figure></div>

<figure><img src="https://4158541773-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUZwvCYi7VuSyayWGoc6M%2Fuploads%2F8L4wT2n8W14YmhspPEwS%2FSk%C3%A6rmbillede%202023-10-04%20163023.png?alt=media&#x26;token=6c6f677a-30df-496d-8715-8ab00f07bfb8" alt=""><figcaption><p>This is how it can be applied in the code. Notice the {% if statement %} wrapping around the TD's</p></figcaption></figure>

Notice how with **Boolean** we can wrap other code bits into a Liquid statement like so:

```liquid
{% if my_input_group_name.my_text_align %}
  <td align="left">
   {% else %}
   <td align="center">
    {% endif %}
```

### Email Editor

<div align="left"><figure><img src="https://4158541773-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUZwvCYi7VuSyayWGoc6M%2Fuploads%2FAuRw2iKoU7OPsqeX00eb%2FSk%C3%A6rmbillede%202023-10-04%20163252.png?alt=media&#x26;token=da547b38-9bf0-4e58-87cf-2b19cdc13877" alt=""><figcaption><p>This is how it looks in the Email Editor</p></figcaption></figure></div>
