Hexpunk
InstallConceptsElementsProsehp-cellhp-codehp-copyhp-hexhp-latexhp-visually-hiddenhp-buttonhp-checkboxhp-formhp-labelhp-radiohp-selecthp-sliderhp-togglehp-toggle-grouphp-badgehp-taghp-progresshp-spinnerhp-backgroundhp-clusterhp-collapsiblehp-demohp-gridhp-scroll-areahp-separatorhp-sidebarhp-toolbarhp-avatarhp-iconhp-pixelhp-linkhp-menubarhp-navigation-menuhp-tabshp-alert-dialoghp-context-menuhp-dialoghp-dropdown-menuhp-hover-cardhp-popoverhp-tooltiphp-bannerhp-toasthp-tetherhp-module-handlehp-unfold-listhp-unfold-overlayhp-unfold-pagehp-bondhp-link-nodePaletteAnimationsReleases

hp-checkbox

Hex checkbox — hollow at rest, primary-filled with a check glyph when checked. indeterminate stamps a horizontal bar for mixed state. Click or Space toggles; focus-ring on keyboard focus.

Examples API Intent Changelog <body> <hp-checkbox></hp-checkbox> <hp-checkbox checked></hp-checkbox> <hp-checkbox indeterminate></hp-checkbox> <hp-checkbox disabled></hp-checkbox> <hp-checkbox checked disabled></hp-checkbox> </body> accept terms <body> <hp-checkbox id="terms"></hp-checkbox> <hp-label for="terms">Accept terms</hp-label> </body>

Install

bun add @hexpunk/core lit
import "@hexpunk/core";

Properties

Property Attribute Type Default Description
checked checked boolean false Current checked state. Toggled on click / Space.
indeterminate indeterminate boolean false Indeterminate (mixed) state — visual is a horizontal bar instead of a check. Sets aria-checked="mixed" for assistive tech. Cleared on next user toggle.
disabled disabled boolean false Disabled — blocks toggle and removes from tab order.
name name string | undefined Optional name for form integration (not yet wired to the form submission API; placeholder for forthcoming hp-form integration).
value value string "on" Optional value (paired with name) for form integration.
size size "xxs" | "xs" | "sm" "xs" Cell size. `xs` (default, 32px) is the comfortable form-input size; `xxs` (20px) is dense / tabular; `sm` (100px) is the content-hex size — rarely useful here but available.

Events

Event Type Description
change CustomEvent When checked changes via user input. detail: { checked }

CSS Parts

Part Description
box The hex container wrapping hp-hex + the glyph
glyph The check / dash glyph overlay

Accessibility

role="checkbox", aria-checked reflects state (true / false / mixed for indeterminate). Space toggles. disabled blocks the toggle and removes from tab order with aria-disabled="true" + tabindex="-1".

No per-component entries in CHANGELOG.md yet.

esc