DocsFramework guides
Get started

Search Subtly documentation

Search by a task, helper name or framework.

Framework guides

Laravel / Blade

Laravel with Vite and server-rendered HTML.

Install

Install via npm, then include @vite(['resources/js/app.js']) in your Blade layout. Use the HTML attributes directly in Blade templates.

Terminal
npm install subtly

Initialize

resources/js/app.js

JavaScript
import { createInteractions } from "subtly";
import "subtly/styles.css";
const ix = createInteractions();
ix.start();
if (import.meta.hot) import.meta.hot.dispose(() => ix.stop());

Use a behavior

HTML
<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

Keep Laravel validation and CSRF protection. Do not layer duplicate positioning or focus behavior over your component library.

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

Preview closed. Hover, focus or click to open.

Actual npm package · local demonstrationHover timing needs a desktop pointer

The live example uses native JavaScript; the framework snippets are integration recipes, not separately compiled framework applications.