# True / False

A **True/False** field type (e.g. [ACF True/False field](https://wplake.org/blog/acf-true-false-field/)), often represented by a checkbox or a pair of radio buttons with **Yes/No** labels, is suitable when you have a statement or question that can be answered with a binary (two-option) response.

## How to use it

**Select** the true/false field from your field **Group**.

{% hint style="success" %}
As an alternative you could use the [Radio Button](/advanced-views/display-content/meta-fields/choice-fields/select-checkbox-radio.md) or [Checkbox](/advanced-views/display-content/meta-fields/choice-fields/select-checkbox-radio.md) field.
{% endhint %}

## Conditional usage

You can use the True/False field in any [Twig conditions](/advanced-views/templates/template-engines/twig.md#conditions).

### Displaying a label conditionally

```twig
<p>The event is {% if true_false.value %}open{% else %}closed{%endif %}.</p>
```

### Adding a class conditionally

```twig
<p class="{% if true_false.value %}event-open{% else %}event-closed{%endif %}">
Event status</p>
```

## Displaying check icon

In addition to conditional usage, the True/False field can be visually represented as a check or cross icon. This approach provides a clear, visual way to display binary information. For this example, we've used the [UTF-8 check and cross icons](https://utf8-icons.com/):

**Twig template:**

{% code overflow="wrap" %}

```twig
<div class="switcher switcher--state--{% if true_false.value %}checked{% else %}unchecked{% endif %}"></div>
```

{% endcode %}

**CSS code:**

```css
.switcher {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.switcher--state--checked::after {
    content: "\2713"; /* Check mark */
    color: green;
}

.switcher--state--unchecked::after {
    content: "\00D7"; /* Cross mark */
    color: red;
}
```


---

# Agent Instructions: 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:

```
GET https://wplake.gitbook.io/advanced-views/display-content/meta-fields/choice-fields/true-false.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
