Stimulus
ELI5 — The Vibe Check
Stimulus is a modest JavaScript framework that adds behavior to your HTML using data attributes. It doesn't render HTML or manage state — it just connects to existing markup and adds interactivity. It's the JavaScript framework for people who think most JavaScript frameworks do too much.
Real Talk
Stimulus is a JavaScript framework from Basecamp (part of Hotwire) that provides a structured way to enhance server-rendered HTML. Controllers are connected to DOM elements via data-controller attributes, with actions, targets, and values providing a convention for organizing JavaScript behavior.
Show Me The Code
<div data-controller="toggle">
<button data-action="click->toggle#toggle">Show</button>
<div data-toggle-target="content" class="hidden">Hello!</div>
</div>
When You'll Hear This
"Stimulus controllers are tiny and focused — one controller per behavior" / "We pair Stimulus with Turbo for an SPA-like experience without the SPA complexity"
Related Terms
Alpine.js
Alpine.js is like jQuery had a baby with Vue, and that baby was really into minimalism.
HTMX
HTMX looked at the entire JavaScript ecosystem and said 'nah.' It lets your server send back HTML instead of JSON, and your page updates itself like magic.
Progressive Enhancement
Progressive Enhancement is the philosophy of building the basics first (HTML that works), then layering on CSS and JavaScript like frosting on a cake.
Turbo
Turbo (from Hotwire) makes traditional server-rendered apps feel like SPAs by intercepting link clicks and form submissions to swap only the page body via...