• Stars
    star
    121
  • Rank 293,924 (Top 6 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created almost 4 years ago
  • Updated 10 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A set of useful pre-built and configurable StimulusJS controllers for various common scenarios

Stimulus-Library

Documentation | Full List of Controllers


npm npm bundle size (version)

Installation

To get started, you'll need to add the stimulus-library package to your project.

To do so, either add stimulus-library to your package.json manually

{
  "dependencies": {
    "stimulus-library": "latest"
  }
}

or run npm install --save stimulus-library or yarn add stimulus-library

Then, to get started, import and register the controllers you want to use.

Please Note as below, that when registering the name for the controller, you should use kebab-case and omit the -controller suffix.

import { Application } from "@hotwired/stimulus";
import { AutoSubmitFormController } from "stimulus-library";

const application = Application.start();
application.register("auto-submit-form", AutoSubmitFormController);

Tree-shaking

If you use the ESM builds of the library, this library fully supports tree-shaking, only the controllers you directly import will be bundled with your application.