Start here
Installation
Subtly is published on npm. Add it to your project and import only the helpers you need.
Terminal
npm install subtlyInitialize the HTML behaviors
JavaScript
import { createInteractions } from "subtly";import "subtly/styles.css"; // optional structural styles
const interactions = createInteractions();interactions.start();
// At application teardown:interactions.stop();Use a standalone utility
Utilities can be imported directly when you need programmatic control.
JavaScript
import { hoverIntent, debounce } from "subtly";Optional floating positioning
The floating helper uses Floating UI as an optional peer dependency. Install it only when using that helper.
Terminal
npm install @floating-ui/domJavaScript
import { floating } from "subtly/floating";Without a bundler
Copy the src/ directory into your site and use native module imports. Serve the site over HTTP so browser modules can load.
HTML
<script type="module"> import { createInteractions } from "./interactions/index.js"; const interactions = createInteractions(); interactions.start();</script>