Vanilla HTML / JavaScript
Native modules, no build step.
Install
Copy src/ to interactions/. Serve over HTTP rather than file://. No npm or framework required.
Initialize
index.html
<link rel="stylesheet" href="./interactions/interactions.css" /><div data-ix="hover-intent"><button type="button">Preview</button></div><script type="module"> import { createInteractions } from "./interactions/index.js"; const ix = createInteractions(); ix.start(); // For a dynamic application, call ix.stop() when its root is removed.</script>Use a behavior
<div data-ix="hover-intent" data-ix-hover-delay="150"> <button type="button">Preview</button></div>Use the shared HTML attributes, or import programmatic helpers inside your framework lifecycle. State and visual rendering stay in your component.
Lifecycle and accessibility
Module scripts are deferred; attach event handlers after parsing. Avoid stopping on pagehide without restarting on BFCache restore.
Use a single runtime per root; do not overlap roots. Keep native button semantics, focus and click support. For cleanup, call each utility’s returned callback or destroy method.
Try the same behavior
A clearer home for your next release.
In progressPreview closed. Hover, focus or click to open.
The live example uses native JavaScript; the framework snippets are integration recipes, not separately compiled framework applications.