Stimulus : A modest JavaScript framework for the HTML you already have.
This technology is used by 10.59% of websites in the JavaScript frameworks category. The most popular industry vertical is Business and Finance, with Arts and Crafts being the top subcategory.
What is Stimulus?
Stimulus is a modest JavaScript framework developed by Basecamp (creators of Ruby on Rails) designed to enhance server-rendered HTML with sprinkles of interactivity. Rather than taking over your entire frontend, Stimulus connects JavaScript behaviors to existing HTML through data attributes.
The framework follows the "HTML-first" philosophy—your server renders complete HTML pages, and Stimulus adds interactivity where needed. Controllers are connected to DOM elements via data-controller attributes, with actions triggered through data-action and state managed via data-target.
Stimulus is a core component of the Hotwire approach (HTML Over The Wire), working alongside Turbo to create fast, SPA-like experiences without writing custom JavaScript for every interaction. It's particularly popular in Rails applications but works with any backend framework.
Industry Vertical Distribution
Technologies Frequently Used with Stimulus
| Technology | Co-usage Rate | Website |
|---|---|---|
| Modernizr | 89.54% | https://modernizr.com |
| Squarespace | 87.23% | http://www.squarespace.com |
| YUI | 83.72% | http://yuilibrary.com |
| Typekit | 71.25% | http://typekit.com |
| Google Font API | 53.76% | http://google.com/fonts |
| Cart Functionality | 52.38% | https://www.wappalyzer.com/technologies/ecommerce/cart-functionality |
| Sentry | 46.19% | https://sentry.io/ |
| Lodash | 39.25% | http://www.lodash.com |
| Google Workspace | 38.98% | https://workspace.google.com/ |
| Google Analytics | 32.98% | http://google.com/analytics |
Stimulus Features
Controllers: ES6 class-based controllers. Automatic instantiation. Lifecycle callbacks. Clean organization. Reusable behaviors.
Actions: Event binding via data attributes. Multiple events per element. Action parameters. Event options. Keyboard shortcuts.
Targets: DOM element references. Automatic pluralization. Target callbacks. Existence checks. Scoped selections.
Values: Typed controller state. Automatic parsing. Change callbacks. Default values. Data attribute synchronization.
CSS Classes: Dynamic class management. Logical class names. State-based styling. Framework agnostic.
Outlets: Cross-controller communication. Reference other controllers. Coordinated behaviors. Loose coupling.
AI-Powered Technology Recommendations
Our AI recommender engine, trained on 100 million data points, suggests these technologies for websites using Stimulus:
| Technology | AI Score | Website |
|---|---|---|
| Squarespace | 0.29 | http://www.squarespace.com |
| YUI | 0.29 | http://yuilibrary.com |
| RackCache | 0.23 | https://github.com/rtomayko/rack-cache |
| Typekit | 0.2 | http://typekit.com |
| SoundManager | 0.18 | http://www.schillmania.com/projects/soundmanager2 |
| Ruby on Rails | 0.16 | https://rubyonrails.org |
| Ruby | 0.16 | http://ruby-lang.org |
| jQuery-pjax | 0.16 | https://github.com/defunkt/jquery-pjax |
| UserWay | 0.13 | https://userway.org/ |
| IPB | 0.13 | https://invisioncommunity.com/ |
IAB Tier 1 Vertical Distribution
Relative Usage by Industry
Market Distribution Comparison
Stimulus Use Cases
Server-Rendered Apps: Rails applications. Django projects. Laravel sites. Phoenix applications. Traditional MVC frameworks.
Progressive Enhancement: Adding interactivity to static HTML. Form enhancements. Dynamic content toggling. UI behaviors.
Hotwire Applications: Turbo-powered apps. Real-time updates. Native mobile apps. Hybrid applications.
Admin Interfaces: Dashboard interactions. Table sorting. Bulk operations. Inline editing. Filter toggles.
Form Handling: Dynamic form fields. Conditional visibility. Character counters. Auto-save features. Validation feedback.
UI Components: Dropdowns and modals. Tab interfaces. Accordion panels. Copy to clipboard. Toggle switches.
IAB Tier 2 Subcategory Distribution
Top Websites Using Stimulus
| Website | IAB Category | Subcategory | OpenRank |
|---|---|---|---|
| knowyourmeme.com | Technology & Computing | Computing | 6.18 |
| crazyegg.com | Business and Finance | Travel Type | 5.95 |
| connietalbot.com | Music and Audio | Personal Celebrations & Life Events | 5.74 |
| basecamp.com | Business and Finance | Computing | 5.64 |
| awwwards.com | Fine Art | Design | 5.62 |
| serverfault.com | Technology & Computing | Computing | 5.6 |
| askubuntu.com | Technology & Computing | Computing | 5.45 |
| symfony.com | Technology & Computing | Computing | 5.41 |
| teepublic.com | Fine Art | Fashion Events | 5.37 |
| cults3d.com | Hobbies & Interests | Design | 5.08 |
Stimulus Code Examples
Controllers and Actions
// hello_controller.js
import { Controller } from "@hotwired/stimulus"
export default class extends Controller {
static targets = ["name", "output"]
static values = { greeting: { type: String, default: "Hello" } }
greet() {
this.outputTarget.textContent =
`${this.greetingValue}, ${this.nameTarget.value}!`
}
}
// dropdown_controller.js
import { Controller } from "@hotwired/stimulus"
export default class extends Controller {
static targets = ["menu"]
static classes = ["open"]
toggle() {
this.menuTarget.classList.toggle(this.openClass)
}
close(event) {
if (!this.element.contains(event.target)) {
this.menuTarget.classList.remove(this.openClass)
}
}
}
HTML with Data Attributes
<!-- Hello Controller -->
<div data-controller="hello" data-hello-greeting-value="Welcome">
<input data-hello-target="name" type="text" placeholder="Enter name">
<button data-action="click->hello#greet">Greet</button>
<span data-hello-target="output"></span>
</div>
<!-- Dropdown with Outside Click -->
<div data-controller="dropdown"
data-action="click@window->dropdown#close"
data-dropdown-open-class="is-open">
<button data-action="dropdown#toggle">Menu</button>
<ul data-dropdown-target="menu" class="hidden">
<li><a href="#">Option 1</a></li>
<li><a href="#">Option 2</a></li>
</ul>
</div>
Usage by Domain Popularity (Top 1M)
Usage by Domain Age
The average age of websites using Stimulus is 10.4 years. The average OpenRank (measure of backlink strength) is 2.51.
Stimulus Benefits
HTML-Centric: Enhances existing HTML. No template compilation. Server-rendered content. Progressive enhancement.
Minimal Footprint: ~9KB minified and gzipped. No virtual DOM. Small learning curve. Fast execution.
Organized Code: Convention over configuration. Clear file structure. Controller pattern. Maintainable JavaScript.
Works Everywhere: Framework agnostic. Any backend language. Static sites. Content management systems.
Turbo Integration: Seamless Hotwire stack. Persistent controllers. Navigation handling. Form submissions.
Developer Experience: TypeScript support. Hot module replacement. Debugging tools. Clear documentation.
Emerging Websites Using Stimulus
| Website | IAB Category | Subcategory | OpenRank |
|---|---|---|---|
| silkroadrising.com | Business and Finance | Industries | 0 |
| augustknox.com | Fine Art | Design | 0 |
| quokkagames.com | Video Gaming | Video Game Genres | 0 |
| heroesreforged.com | Movies | World Movies | 0 |
| bubbleupbw.com | Events and Attractions | Travel Type | 0 |
Technologies Less Frequently Used with Stimulus
| Technology | Co-usage Rate | Website |
|---|---|---|
| 6sense | 0% | https://6sense.com |
| Accessibility Toolbar Plugin | 0% | https://webworks.ga/acc_toolbar |
| Ad Lightning | 0% | https://www.adlightning.com |
| Adobe ColdFusion | 0% | http://adobe.com/products/coldfusion-family.html |
| Adobe Flash | 0% | https://www.adobe.com/products/flashplayer |
