Stimulus: Speed up your Rails Apps with Hotwire…

Reading Time: 3 minutes

Introduction to Stimulus

Stimulus is a Javascript framework designed to enhance static or server-rendered HTML by connecting JavaScript objects to elements on the page called "controllers" using simple annotations.

It belongs to a bundle of server-side frameworks and technologies called Hotwire. Stimulus is complementary to the other technologies that compose Hotwire and together can be used to create a responsive user experience while keeping most of the logic on the server side.

Installation

Stimulus, as part of Hotwire, is configured by default in Rails 7+ applications unless the –skip-hotwire flag is passed to the rails new generator.

For older versions of Rails you can use Stimulus with any asset packaging systems or include it from its CDN with a