# Stimulus

> A modest JavaScript framework for the HTML you already have

Source: https://talira.ai/catalog/stimulus-p6z2qebs
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [frontend / progressive enhancement](https://talira.ai/categories/frontend/progressive-enhancement), [languages / javascript](https://talira.ai/categories/languages/javascript), [frameworks / rails](https://talira.ai/categories/frameworks/rails)
- Licence: MIT[^2]
- Pricing: Free and open source[^2]
- Free tier: yes[^2]
- Self-hostable: yes[^2]
- API: yes[^4]
- Backed by: [37signals](https://talira.ai/orgs/37signals.md)
- Funding: bootstrapped[^5][^6][^7]

Stimulus is a small JavaScript framework that adds behaviour to server-rendered HTML instead of rendering it: `data-controller`, `data-action` and `data-*-target` attributes connect elements to controller classes, and state lives in the HTML. It watches the page and connects controllers whenever matching attributes appear, whether from a full page load, a Turbo page change or an Ajax update. 37signals extracted it from Basecamp, and with [Turbo](https://talira.ai/catalog/turbo-437970n4.md) it forms [Hotwire](https://talira.ai/catalog/hotwire-019t5gng.md). The `stimulus-rails` gem sets it up in [Ruby on Rails](https://talira.ai/catalog/ruby-on-rails-xkdcpj5k.md) apps with import maps or a JavaScript bundler, and Rails 7 and later configure it by default.

## Links

- Website: https://stimulus.hotwired.dev/
- GitHub: https://github.com/hotwired/stimulus
- Docs: https://stimulus.hotwired.dev/handbook/introduction

## Problems it solves

- add a bit of interactivity to server-rendered pages without a single-page app framework
- our jQuery snippets break after Turbo page changes because nothing rebinds them
- wire a button in my HTML to a JavaScript method without writing selectors by hand
- attach JavaScript behaviour to elements that get inserted into the page later
- organise the scattered JavaScript sprinkles in a Rails app into reusable pieces
- toggle, copy to clipboard and show a dropdown on pages my server renders
- keep UI state in the HTML so the server stays the source of truth
- progressively enhance HTML forms with client-side behaviour
- a small team wants interactive pages without maintaining a separate front-end app
- set up JavaScript controllers in a Rails app that uses import maps and no Node build
- add small pieces of JavaScript behaviour to HTML my server already renders, without React or Vue
- a lightweight alternative to React for making Rails views interactive
- connect HTML elements to JavaScript classes with data attributes instead of hand-written selectors

## Features

- controllers connected with data-controller attributes
- actions with data-action (event->controller#method)
- targets with data-*-target attributes
- values stored in data attributes
- lifecycle callbacks when elements connect and disconnect
- works with any DOM update: full loads, Turbo and Ajax
- stimulus-rails installer for import maps or JavaScript bundlers

## Limitations

- Doesn't render HTML or client-side templates: it adds behaviour to HTML the server already rendered[^1]

## Capabilities

- Has an API: plan not known

## Trust

Overall: 0.42 out of 1.
Signals: backing 0.55, extensibility 0.20.

- backed by 37signals
- funding: bootstrapped

Warnings:

- GitHub activity not fetched yet

## Related

- Works with [Hotwire](https://talira.ai/catalog/hotwire-019t5gng.md)

## Alternatives

- [htmx](https://talira.ai/catalog/htmx-77jdt43j.md): High power tools for HTML
- [React on Rails](https://talira.ai/catalog/react-on-rails-xxfb5g89.md): Integration of React + Webpack + Rails including server-side rendering of React
- [Alpine.js](https://talira.ai/catalog/alpine-js-yfx5mnga.md): Your new, lightweight, JavaScript framework

## Sources

[^1]: https://stimulus.hotwired.dev/handbook/origin (checked 20 Nov 2026)
[^2]: https://github.com/hotwired/stimulus/blob/main/LICENSE.md (checked 20 Nov 2026)
[^3]: https://stimulus.hotwired.dev/ (checked 20 Nov 2026)
[^4]: https://github.com/hotwired/stimulus (checked 20 Nov 2026)
[^5]: https://37signals.com/01 (checked 21 Nov 2026)
[^6]: https://37signals.com/jobs (checked 21 Nov 2026)
[^7]: https://basecamp.com/pricing (checked 21 Nov 2026)
