> ## Documentation Index
> Fetch the complete documentation index at: https://validity-kt.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Booleans

> isTrue and isFalse, for consents, confirmations and flags.

Two constraints for `Boolean` values, such as the checkbox that accepts the terms. Their messages are `mustBeTrue` and
`mustBeFalse`, since a message property cannot be named `isTrue`.

```kotlin Consent.kt theme={null}
data class Consent(
    val hasAcceptedTerms: Boolean?,
    val isMinor: Boolean?
) : Validatable {
    override fun validation() = validation {
        ::hasAcceptedTerms required { isTrue() }
        ::isMinor required { isFalse() }
    }
}
```

| Constraint | Checks |
| - | - |
| [`isTrue`](#istrue) | Is `true`. |
| [`isFalse`](#isfalse) | Is `false`. |

### `isTrue`

`isTrue()` on `Boolean`

Checks that the value is `true`.

**Code** `isTrue`· **Message** `must be true` · **Change it** `mustBeTrue = "…"`

### `isFalse`

`isFalse()` on `Boolean`

Checks that the value is `false`.

**Code** `isFalse`· **Message** `must be false` · **Change it** `mustBeFalse = "…"`


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.