Checkbox

Headless checkbox primitives for Roblox UI.

Stable direction
@lattice-ui/checkbox

Part of the stable direction toward v1.0.

What It Is For

Use Checkbox for boolean or tri-state choices where the control itself is the interaction target.

It is useful when you need indeterminate state and want to keep the visual host fully custom.

Preview size

Live demo is experimental and may contain bugs.

Install

Global CLI command: lattice add checkbox

Monorepo local script

Use your package manager wrapper when running the local lattice command.

pnpm lattice add checkbox

npm package: @lattice-ui/checkbox

Peer dependencies

  • @rbxts/react
  • @rbxts/react-roblox

Public Exports

  • Checkbox
  • Checkbox.Root
  • Checkbox.Indicator
  • CheckboxIndicator
  • CheckboxRoot

State Model

  • checked supports true, false, and "indeterminate".
  • Checkbox.Root supports both controlled and uncontrolled state via checked or defaultChecked.
  • Checkbox.Indicator reflects the current checked state and can remain mounted with forceMount.

Key API

Checkbox.Root

Use checked, defaultChecked, onCheckedChange, disabled, and required to integrate with your own form model.

Checkbox.Root asChild

Set asChild when you want the click behavior attached to an existing button-like element instead of the default host.

Checkbox.Indicator

Mount visual marks, fills, or icons inside the checkbox without rebuilding checked-state plumbing.

Composition Patterns

Checklist rows

Wrap the interactive host with Checkbox.Root asChild and render the label beside it so the state lives in one place.

Partial selection

Use "indeterminate" for parent-group selection UIs where some but not all descendants are active.

Cautions / Limits

  • The default toggle cycle is indeterminate -> true -> false; account for that if you map the value into external state.
  • Use Switch instead of Checkbox when the UI should communicate an immediate on/off setting rather than selection membership.

Decision Guides