hp-radio
Single radio button — pairs with <hp-radio-group> as a parent. The
group manages selection, arrow-key navigation, and dispatches the change
event. Individual hp-radio renders the hex chrome (hollow at rest, primary-
filled with a concentric dot when checked) and emits hp-radio-select on
activation.
Install
bun add @hexpunk/core lit import "@hexpunk/core"; Properties
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
value | value | string | "" | Value emitted when this radio is selected. Required for the parent hp-radio-group to track selection. |
checked | checked | boolean | false | Selected state. Set by the parent hp-radio-group; consumers shouldn't write directly — use the group's `value` instead. |
disabled | disabled | boolean | false | Disabled — blocks selection, removes from tab order. |
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 |
|---|---|---|
hp-radio-select | CustomEvent | When this radio is activated. detail: { value } |
CSS Parts
| Part | Description |
|---|---|
radio | The radio container wrapping hp-hex + inner dot |
dot | The inner filled hex shown when checked |
Accessibility
Group exposes role="radiogroup"; each child role="radio" with
aria-checked. Arrow keys move focus + selection between children
(ArrowDown / ArrowUp for vertical, ArrowLeft / ArrowRight for horizontal); Home / End
jump to first / last. Only one radio is tabbable at a time (roving tabindex pattern).
No per-component entries in CHANGELOG.md yet.