npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

stimulus-check-all

v0.6.0

Published

A Stimulus Controller to implement check-all checkbox feature

Downloads

20

Readme

Stimulus CheckAll

npm version npm downloads MIT License

A wrapper for @github/check-all as a Stimulus Controller.

Keep track of all the changes in the Changelog

Install

This package assumes that you have Stimulus installed and set up.

Install the library in your project with:

yarn add stimulus-check-all
# or
npm install --save stimulus-check-all

And register the controller in your application

import { Application } from "stimulus"
import CheckAll from "stimulus-check-all"

const application = Application.start()
application.register("check-all", CheckAll)

You can also use a UMD build directly from UNPKG, which will make the controller globally available as StimulusCheckAll (it also bundles @github/check-all)

<script src="https://unpkg.com/stimulus/dist/stimulus.umd.js"></script> <!-- Stimulus must be loaded globally -->
<script src="https://unpkg.com/stimulus-check-all@latest/dist/stimulus-check-all.umd.js"></script> <!-- or 'stimulus-check-all.umd.min.js' -->

There is also a CommonJS build on UNPKG:

https://unpkg.com/stimulus-check-all/dist/stimulus-check-all.js
https://unpkg.com/stimulus-check-all/dist/stimulus-check-all.min.js

Usage

For the most basic usage create a div with some checkboxes. In the case you want to exclude some checkboxes from the check-all features, add a data-skip attribute to those checkboxes.

<div data-controller="check-all">
  <div>Count: <span data-target="check-all.count">0</span></div> <!-- optional -->
  <label><input type="checkbox" data-target="check-all.all"> Check All</label> <!-- optional -->
  <label><input type="checkbox"> github/fetch</label>
  <label><input type="checkbox"> github/textarea-autosize</label>
  <label><input type="checkbox"> github/eventlistener-polyfill</label>
  <label><input type="checkbox"> github/quote-selection</label>
  <label><input type="checkbox" data-skip> skip-this-one</label> <!-- this one is skipped -->
</div>

Targets

All of them are optional, as they are in @github/check-all.

  • all: The checkbox used to check all of the other ones in the container
  • count: Displays the number of selected checkboxes

Extending controller

You can extend the functionality of the controller using inheritance. Just remember to call super if overriding any of the parent's methods, like connect or disconnect:

import CheckAllController from 'stimulus-check-all'

export default class extends CheckAllController {
  connect () {
    super.connect()

    // your custom code
  }
}

Apart from access to the targets defined in the parent class, the controller exposes three other properties:

  • checkboxes: All the checkboxes where the check-all feature is applied
  • checked: The checked checkboxes
  • unchecked: The unchecked checkboxes

Contributing

Bug reports and pull requests are more than welcome on GitHub.

Coding standards

This project uses Standard to minimize bike shedding related to code formatting.

Please run npm run lint prior submitting pull requests.

License

The software is available as open source under the terms of the MIT License.