Attractive.js 1.0.0 lets developers add interactivity via HTML attributes alone
A developer has released Attractive.js 1.0.0, a lightweight JavaScript library that enables interactive web behaviors using declarative HTML attributes rather than custom JavaScript code. The library uses an @action and @target syntax, replacing the older data-action and data-target conventions, making markup more readable and easier to scan. Built-in actions cover common interactions such as toggling classes, copying to clipboard, managing dialogs, form submission, and scroll-triggered events, all configurable through triggers and gates. Developers can also extend the library with custom actions, triggers, and gates, and an addon ecosystem aims to position Attractive.js as an alternative to frameworks like Hotwire and Stimulus. The 1.0.0 release is currently available as a pre-release, with upcoming posts planned to cover custom actions and a real-world Rails integration.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.



Discussion (0)
Log in to join the discussion and vote.
Log in