# @zag-js/checkbox

> Core logic for the checkbox widget implemented as a state machine

Latest version **1.44.0** (published 2026-09-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install @zag-js/checkbox
pnpm add @zag-js/checkbox
yarn add @zag-js/checkbox
bun add @zag-js/checkbox
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1.44.0 |
| Published | 2026-09-13 |
| First published | 2022-06-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 6 |
| Unpacked size | 43.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5217 |
| Author | Segun Adebayo <sage@adebayosegun.com> |
| Maintainers | segunadebayo |
| Keywords | js, machine, xstate, statechart, component, chakra-ui, checkbox |

## Links

- npm: https://www.npmjs.com/package/@zag-js/checkbox
- Repository: https://github.com/chakra-ui/zag/tree/main/packages/checkbox
- Homepage: https://github.com/chakra-ui/zag#readme
- Issues: https://github.com/chakra-ui/zag/issues
- npm.io page: https://npm.io/package/@zag-js/checkbox

## Dependencies (6)

- [@zag-js/core](https://npm.io/package/@zag-js/core.md) 1.44.0
- [@zag-js/types](https://npm.io/package/@zag-js/types.md) 1.44.0
- [@zag-js/utils](https://npm.io/package/@zag-js/utils.md) 1.44.0
- [@zag-js/anatomy](https://npm.io/package/@zag-js/anatomy.md) 1.44.0
- [@zag-js/dom-query](https://npm.io/package/@zag-js/dom-query.md) 1.44.0
- [@zag-js/focus-visible](https://npm.io/package/@zag-js/focus-visible.md) 1.44.0

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.44.0 (latest) — 2026-09-13
- 2.0.0-next.3 (next) — 2026-09-14
- 0.0.0-v1-beta-20250222173217 (v1-beta) — 2025-02-22
- 0.0.0-dev-20240723090825 (dev) — 2024-07-23
- 2.0.0-next.2 — 2026-08-31
- 1.43.3 — 2026-08-20
- 1.43.2 — 2026-08-20
- 1.43.1 — 2026-08-16
- 2.0.0-next.1 — 2026-08-01
- 1.43.0 — 2026-07-29
- 1.42.0 — 2026-06-29
- 1.41.2 — 2026-06-05
- 2.0.0-next.0 — 2026-06-04
- 1.41.1 — 2026-05-26
- 1.41.0 — 2026-05-21
- … 1070 more at https://npm.io/package/@zag-js/checkbox/versions

## README

# @zag-js/checkbox

Core logic for the checkbox widget implemented as a state machine

## **Installation**

```sh
yarn add @zag-js/checkbox
# or
npm i @zag-js/checkbox
```

## Technical Considerations

- When the checkbox is surrounded by a form, we consider the effect of form "reset" event with a `trackFormReset`
  activity in the machine.
- When the checkbox is surrounded by fieldset and the fieldset is disabled, we react to set sync the disabled state
  accordingly with a `trackFieldsetDisabled` activity in the machine.
- A name can be passed to the machine object during initialization, which we pass to the input, to ease use in forms.
- The API exposes a `setChecked` method to programmatically control the checkbox's state. We automatically dispatch a
  native event when this is done, so when used in a form, the form can detect those changes.
- The checkbox machine accepts an `indeterminate` key, to make it indeterminate by default. The API also exposes a
  `setIndeterminate` method, to toggle this programmatically.
- The API exposed a `view` variable of type `"checked" | "unchecked" | "mixed"` so you can render parts, based on the
  current visual state of the checkbox. `mixed` is when the checkbox is indeterminate.

## Contribution

Yes please! See the [contributing guidelines](https://github.com/chakra-ui/zag/blob/main/CONTRIBUTING.md) for details.

## Licence

This project is licensed under the terms of the [MIT license](https://github.com/chakra-ui/zag/blob/main/LICENSE).

---
_Source: https://npm.io/package/@zag-js/checkbox · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
