Methane@methane-ui/*
CSS LayoutsComponentsSkillsTheme BuilderGitHub
← All Components

<mth-checkbox>

@methane-ui/ui~9.0 KB brotli (cold + Lit)~2.6 KB marginal

Tri-state form-associated checkbox supporting checked/indeterminate custom states, FACE validation, same-root ARIA, and FieldContext.

When NOT to use: Do not use <mth-checkbox> for immediate live-toggling settings without form submit; use <mth-switch>.

Live Interactive Preview

Interactive StageLive Custom Element · <mth-checkbox> (@methane-ui/ui)
Accept Methane Design System terms
Ready · interact with <mth-checkbox>, or toggle Theme, Direction (LTR/RTL), or props above.

Live Variants & States Showcase

uncheckedUnchecked option
checkedChecked option
indeterminateMixed selection
disabledDisabled offDisabled checked

Multi-Framework Playground & Snippets

<script type="module" src="@methane-ui/ui/checkbox"></script>
<mth-checkbox value="on">Example</mth-checkbox>

Properties & Attributes

PropertyAttributeTypeDefaultDescription
checkedcheckedbooleanfalseWhether the checkbox is checked.
indeterminateindeterminatebooleanfalseMixed visual and ARIA state (aria-checked="mixed").
valuevaluestring"on"Form value submitted when checked (defaults to "on").
namenamestring""Form submission field name.
labellabelstring""Accessible label when default slot is omitted.
hinthintstring""Helper text linked via aria-describedby inside shadow root.
errorerrorstring""Explicit custom error message displayed inside shadow root.
disableddisabledbooleanfalseDisables checkbox interaction.
requiredrequiredbooleanfalseMarks checkbox required for constraint validation.
readonlyreadonlybooleanfalsePrevents toggling while remaining focusable and submittable.

Events

EventDetail TypeDescription
mth-change{ checked: boolean; indeterminate: boolean; value: string }Emitted when checked state toggles via user interaction.

APG Keyboard Matrix

KeyDirectionWhenExpected Behavior
bothfocused and not disabled or readonlytoggles checked state and clears indeterminate

Accessibility Checklist

CategoryRequirementVerified By
ariaAll aria-* IDREFs resolve within the same DOM root (ADR-003).scanSameRootAria
focusdelegatesFocus: true with zero host internals.role (ADR-014).lint-plugin & spec-compiler
contrastRenders legible borders, focus outlines, and selection indicators under forced-colors: active.Playwright forced-colors matrix
keyboardImplements all 1 APG keyboard transitions across LTR/RTL.mth-checkbox.spec.test.ts
statesExposes ElementInternals CustomStateSet flags: :state(checked), :state(indeterminate), :state(dirty), :state(touched), :state(user-invalid), :state(disabled), :state(required), :state(readonly).Conformance suite
i18nRoutes 3 UI/ARIA strings through @methane-ui/core i18n catalog.Locale context test