---
title: Boolean field
description: Display a true or false value.
---

A boolean field declares a value that is `true` or `false`. Display variants tell
the renderer how to show the state. Input variants tell a form which control to
use.

## API

```ts
fields.boolean<Name extends string>(
  name: Name,
  options?: BooleanFieldOptions
): BooleanFieldBuilder<Name>
```

| Option           | Input                  | Result                              |
| ---------------- | ---------------------- | ----------------------------------- |
| `label`          | `string`               | Sets the text shown for the field.  |
| `description`    | `string`               | Adds supporting text for the label. |
| `displayVariant` | `check` or `badge`     | Selects the read-only presentation. |
| `inputVariant`   | `checkbox` or `toggle` | Selects the form control.           |

`configure(options)` returns a configured clone. `clone()` returns an
independent copy with the same options.

## Basic boolean field

The protocol keeps `true`, `false`, and an empty value distinct.

<BacklitExample path="fields/boolean/basic" view="detail" />

## Description

Use a description to explain what makes the state true.

<BacklitExample path="fields/boolean/description" view="detail" />

## Display variants

Use `check` for a compact state marker. Use `badge` when the state must read as
a status. The renderer controls the final visual form.

<BacklitExample path="fields/boolean/display_variants" view="detail" />

## Input variants

Use `checkbox` for a conventional boolean input. Use `toggle` when the control
represents an immediate on or off state.

<BacklitExample path="fields/boolean/input_variants" view="detail" />

## Clone

Use `configure` to change a variant without changing the original field.

<BacklitExample path="fields/boolean/clone" view="detail" />

## All options

You can use a label, description, display variant, and input variant on the same
boolean field.

<BacklitExample path="fields/boolean/all_options" view="detail" />
