Stimulus: just enough JS
HTML stays the source of truth
Turbo covers navigation and live updates without any hand-written JS. But a few things genuinely need a script β confirming before a destructive click, toggling a setting, debouncing a search box. Stimulus is Hotwire's answer: small, reusable controllers that attach behavior to plain HTML via data- attributes, instead of a framework that owns and re-renders the DOM itself.
Three vocabulary words, and that's most of Stimulus: a controller is a JS class connected to an element via data-controller="name". A target is a specific child element the controller needs to read or change, marked data-name-target="thing". An action wires a DOM event to a controller method: data-action="click->name#method" means "when this element is clicked, call method on the name controller." The HTML declares the wiring; the JS just supplies the behavior.