hp-pixel
Box-shadow pixel art. Static, smooth state morph, or sprite-sheet (sprite mode comes later). The two pixel icons below share the same nine logical pixels — hover them to see the smooth interpolation.
Install
bun add @hexpunk/core lit import "@hexpunk/core"; Properties
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
art | art | string | undefined | — | Static ASCII grid. `#` = lit, `.` = empty, digits index into `palette`. |
state | state | string | undefined | — | Current state when `.states` is set. Falls back to `"idle"`. |
pixelSize | pixel-size | number | 3 | Pixel size in CSS px. Default `3`. |
interactive | interactive | boolean | false | Auto-swap to `hover` / `focus` / `active` named states on the matching pseudo-classes. No JS state-flip required. |
When to use
interactive wires CSS-only
fallbacks for :hover / :focus-visible / :active /
[aria-pressed].
--hp-pixel-shadow at runtime if you need to script frames
imperatively (custom transitions, sprite playback). Don't set the shadow when
interactive is enabled — the inline override beats the CSS-driven swaps.
<hp-pixel> when you need stroke-icon parity. Use
<hp-icon> for Lucide-style icons that should match icon-sm/md/lg
tokens.
No per-component entries in CHANGELOG.md yet.