Checkbox

Lets users select one or more options, or toggle a single setting before submitting.
Stable
Web
iOS
Android
@advui/core
Source
JSX
<Checkbox aria-label="Accept terms" />
size

Installation

pnpm
pnpm add @advui/core
npm
npm install @advui/core

Usage

import { Checkbox, HStack, Label } from '@advui/core'

<HStack gap="2">
  <Checkbox id="terms" checked={accepted} onCheckedChange={setAccepted} />
  <Label htmlFor="terms">Accept terms and conditions</Label>
</HStack>

Examples

With label

Indeterminate (select all)

API reference

Checkbox

PropTypeDefaultDescription
checkedboolean | 'indeterminate'—Controlled state.
defaultCheckedboolean | 'indeterminate'falseInitial state when uncontrolled.
onCheckedChange(checked: boolean | 'indeterminate') => void—Called when toggled.
size'sm' | 'md''md'16 or 20px.
disabledbooleanfalsePrevents toggling.
invalidbooleanfalseError styling + `aria-invalid`.
namestring—Field name when a native form is submitted.Web only.
valuestring—Value sent with the form when checked.Web only.
requiredboolean—The native form will not submit until it is checked.Web only.

Accessibility

  • Exposes role="checkbox" with aria-checked = true / false / mixed.
  • Link a Label with htmlFor for a larger hit area and an accessible name.
  • A hidden native input keeps form submission and autofill working on web.
Keyboard interactions
KeyAction
SpaceToggles the checkbox.

Platform notes

Web
Custom-drawn control backed by a hidden <input type="checkbox">.
iOS
Pressable with checkbox semantics (iOS has no native checkbox).
Android
Pressable with checkbox semantics announced by TalkBack.
Since v0.1.0Last updated Nov 2, 2026Edit this page on GitHub