hp-toggle
Two-state on / off switch. Hex thumb slides between the off and on positions inside a
pill-shaped track. role="switch", Space / Enter activate, aria-checked
reflects state.
Install
bun add @hexpunk/core lit import "@hexpunk/core"; Properties
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
checked | checked | boolean | false | On (checked) state. |
disabled | disabled | boolean | false | Disabled — no activation, removed from tab order. |
name | name | string | undefined | — | Optional form name (placeholder for forthcoming hp-form wiring). |
value | value | string | "on" | Submitted value when checked. |
Events
| Event | Type | Description |
|---|---|---|
change | CustomEvent | When the switch flips via user input. detail: { checked } |
CSS Parts
| Part | Description |
|---|---|
track | The pill-shaped track element |
thumb | The sliding hex thumb |
When to use
No per-component entries in CHANGELOG.md yet.