# Checkbox

> Checkbox is a check box with its label beside it, for lists of independent yes/no choices such as what to include in an export.

URL: https://xichil.dev/docs/xis-mvui/v1/widgets/checkbox/ · Updated: 2026-11-06 · Applies to: Fabric, Quilt, Legacy Fabric, Forge, NeoForge, MC 1.7.10 - 26.3

A check box with its label to the right. It holds the same kind of value as a [Toggle](https://xichil.dev/docs/xis-mvui/v1/widgets/toggle/index.md), drawn
differently: use check boxes for lists of independent yes/no choices, a toggle for settings.

```java
Checkbox.builder("includeKeys")
        .label(Text.translatable("mymod.includeKeys", "Include key bindings"))
        .value(() -> export.includeKeys)
        .onChange(checked -> export.includeKeys = checked)
        .build();
```

## Builder

| Method | Required | Default | Notes |
| --- | --- | --- | --- |
| `label(Supplier<Text>)` / `label(Text)` | yes | | the text to the right of the box |
| `value(BooleanSupplier)` | yes | | whether it is checked; re-read on every refresh |
| `onChange(Consumer<Boolean>)` | yes | | stores the new state; main thread |
| `enabled`, `tooltip`, `visible` | no | | [options every widget has](https://xichil.dev/docs/xis-mvui/v1/widgets/index.md#options-every-widget-has) |

## Behaviour

- A click calls `onChange` with the opposite of `value`; the box shows the new state only if `value` returns it.
- From 1.16 it is vanilla's own check box; older versions get an equivalent drawing.
- **Footer:** no.

## Test it

```java
host.click("includeKeys");
```

Rendered as `[checkbox includeKeys] [x] Include key bindings`, or `[ ]` while unchecked.

## See also

- Javadoc: [Checkbox](https://xichil.dev/javadoc/xis-mvui/v1/dev/xichil/mvui/Checkbox.html)
