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-toggle-group

Group of toggle buttons with single or multi-select semantics. Slotted children carry value attributes; the group tracks value (string in single mode, space-separated in multiple mode) and stamps aria-pressed on each pressed child.

Examples API Intent Changelog left center right <body> <hp-toggle-group type="single" value="left"> <hp-button value="left">left</hp-button> <hp-button value="center">center</hp-button> <hp-button value="right">right</hp-button> </hp-toggle-group> </body> B I U <body> <hp-toggle-group type="multiple" value="bold italic"> <hp-button value="bold">B</hp-button> <hp-button value="italic">I</hp-button> <hp-button value="underline">U</hp-button> </hp-toggle-group> </body>

Install

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

Properties

Property Attribute Type Default Description
type type HpToggleGroupType "single" Selection model. `single` allows one button pressed at a time (toggling on a different button unpresses the previous one). `multiple` allows any combination.
value value string "" Current selection. Single mode: the chosen value as a string; empty string = nothing selected. Multiple mode: space-separated values.
orientation orientation "horizontal" | "vertical" "horizontal" Layout direction — also drives the honeycomb zigzag direction when `layout="honeycomb"`.
layout layout HpToggleGroupLayout "flex" Visual arrangement. - `flex` (default) — children laid out as inline-flex with a standard row / column. - `honeycomb` — children positioned in a hex-grid zigzag. Subsequent items add to the right (orientation=horizontal) or alternate bottom-right / bottom-left (orientation=vertical). Each adjacent pair shares an edge with hp-grid's stroke-overlap correction so the strokes coincide into a single line.
disabled disabled boolean false Disable the entire group.

Events

Event Type Description
change Event When selection changes. detail: { value }

Slots

Slot Description
(default) hp-button or hp-cell children with `value` attributes

Accessibility

Single mode uses role="radiogroup" (mutually-exclusive selection); multiple uses role="group". Each pressed child carries aria-pressed="true".

No per-component entries in CHANGELOG.md yet.

esc