Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hotwired/stimulus
A modest JavaScript framework for the HTML you already have
https://github.com/hotwired/stimulus
Last synced: 5 days ago
JSON representation
A modest JavaScript framework for the HTML you already have
- Host: GitHub
- URL: https://github.com/hotwired/stimulus
- Owner: hotwired
- License: mit
- Created: 2016-12-17T00:19:29.000Z (about 8 years ago)
- Default Branch: main
- Last Pushed: 2024-10-29T16:10:21.000Z (about 2 months ago)
- Last Synced: 2024-12-09T17:17:15.726Z (12 days ago)
- Language: TypeScript
- Homepage: https://stimulus.hotwired.dev/
- Size: 4.38 MB
- Stars: 12,746
- Watchers: 197
- Forks: 427
- Open Issues: 85
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
- my-awesome-list - stimulus
- awesome-list - stimulus
- awesome-starred - hotwired/stimulus - A modest JavaScript framework for the HTML you already have (others)
- awesome-hotwire - Stimulus GitHub
- awesome-hotwire - Stimulus GitHub
README
# Stimulus
### A modest JavaScript framework for the HTML you already have
Stimulus is a JavaScript framework with modest ambitions. It doesn't seek to take over your entire front-end—in fact, it's not concerned with rendering HTML at all. Instead, it's designed to augment your HTML with just enough behavior to make it shine. Stimulus pairs beautifully with [Turbo](https://turbo.hotwired.dev) to provide a complete solution for fast, compelling applications with a minimal amount of effort.
How does it work? Sprinkle your HTML with controller, target, and action attributes:
```html
Greet
```Then write a compatible controller. Stimulus brings it to life automatically:
```js
// hello_controller.js
import { Controller } from "@hotwired/stimulus"export default class extends Controller {
static targets = [ "name", "output" ]greet() {
this.outputTarget.textContent =
`Hello, ${this.nameTarget.value}!`
}
}
```Stimulus continuously watches the page, kicking in as soon as attributes appear or disappear. It works with any update to the DOM, regardless of whether it comes from a full page load, a [Turbo](https://turbo.hotwired.dev) page change, or an Ajax request. Stimulus manages the whole lifecycle.
You can write your first controller in five minutes by following along in the [Stimulus Handbook](https://stimulus.hotwired.dev/handbook/introduction).
You can read more about why we created this new framework in [The Origin of Stimulus](https://stimulus.hotwired.dev/handbook/origin).
## Installing Stimulus
You can use Stimulus with any asset packaging systems. And if you prefer no build step at all, just drop a `` tag on the page and get right down to business.
See the [Installation Guide](https://stimulus.hotwired.dev/handbook/installing) for detailed instructions.
## Getting Help
Looking for the docs? Once you've read through the Handbook, consult the [Stimulus Reference](https://stimulus.hotwired.dev/reference/controllers) for API details.
Have a question about Stimulus? Connect with other Stimulus developers on the [Hotwire Discourse](https://discuss.hotwired.dev/) community forum.
## Contributing Back
Find a bug? Head over to our [issue tracker](https://github.com/hotwired/stimulus/issues) and we'll do our best to help. We love pull requests, too!
We expect all Stimulus contributors to abide by the terms of our [Code of Conduct](CODE_OF_CONDUCT.md).
### Development
- Fork the project locally
- `yarn install`
- `yarn start` - to run the local dev server with examples
- `yarn test` - to run the unit tests
- `yarn lint` - to run the linter with ESLint
- `yarn format` - to format changes with Prettier## Acknowledgments
Stimulus is [MIT-licensed](LICENSE.md) open-source software from [Basecamp](https://basecamp.com/), the creators of [Ruby on Rails](https://rubyonrails.org).
Continuous integration VMs generously provided by [Sauce Labs](https://opensource.saucelabs.com/).
---
© 2024 Basecamp, LLC.