Skip to content
coatx
Esc
↑↓navigate↵open⌘Jpreview
On this page

Checkbox

Checkbox control, checkmark indicator, and horizontal/vertical group recipes.

Usage

import { Checkbox, CheckboxIndicator } from "@ilha/ui-sdk/checkbox";
import { checkbox, checkboxIndicator } from "coatx/checkbox";

export const TermsCheckbox = () => (
  <Checkbox
    aria-label="Accept terms"
    class={(state) =>
      checkbox({ checked: state.checked, indeterminate: state.indeterminate })
        .class
    }
  >
    <CheckboxIndicator
      keepMounted
      class={(state) => checkboxIndicator({ checked: state.checked }).class}
    >
      ✓
    </CheckboxIndicator>
  </Checkbox>
);

Exports (coatx/checkbox)

Export Description
checkbox(options?) Checkbox button recipe
checkboxIndicator(options?) Checkmark / dash indicator slot
checkboxGroup(options?) Group wrapper (vertical or horizontal)
checkboxStyles Compiled StyleX style map

Options

Option Type Default
checked boolean false
indeterminate boolean false
disabled boolean false
invalid boolean false

Was this page helpful?