No description
Find a file
dependabot[bot] 394901bd3a
Bump stylelint from 16.24.0 to 16.25.0 (#37)
Bumps [stylelint](https://github.com/stylelint/stylelint) from 16.24.0 to 16.25.0.
- [Release notes](https://github.com/stylelint/stylelint/releases)
- [Changelog](https://github.com/stylelint/stylelint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/stylelint/stylelint/compare/16.24.0...16.25.0)

---
updated-dependencies:
- dependency-name: stylelint
  dependency-version: 16.25.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-18 16:42:03 +02:00
.github Bump actions/setup-node from 5 to 6 (#34) 2025-10-18 13:13:44 +02:00
src Add FormAutosubmitElement (#32) 2025-10-17 13:58:18 +02:00
.gitignore Create public release 2025-03-26 08:39:17 +01:00
CHANGELOG.md Release v0.3.0 2025-10-17 14:01:00 +02:00
eslint.config.js Create public release 2025-03-26 08:39:17 +01:00
index.html Add FormAutosubmitElement (#32) 2025-10-17 13:58:18 +02:00
LICENSE Create public release 2025-03-26 08:39:17 +01:00
logo_tree.png Create public release 2025-03-26 08:39:17 +01:00
package.json Bump stylelint from 16.24.0 to 16.25.0 (#37) 2025-10-18 16:42:03 +02:00
README.md Create public release 2025-03-26 08:39:17 +01:00
vite.config.js Create public release 2025-03-26 08:39:17 +01:00
yarn.lock Bump stylelint from 16.24.0 to 16.25.0 (#37) 2025-10-18 16:42:03 +02:00

Sprinkles

Sprinkles is a small library to add small amounts of javascript to your html.

We try to simplify working with custom elements by:

  • Reducing the amount of boilerplate you have to write to add and remove event listeners
  • Providing a convention for referencing nodes within your element

This approach takes inspiration from AlpineJS and Stimulus, but is fully build around custom elements.

Using the library

Build your own elements

You can easily build your own custom element on top of SprinklesElement. A simple hello world:

import { SprinklesElement } from "sprinkles-js";

class HelloWorldElement extends SprinklesElement {
  static tagName = "hello-world";
  static events = {
    click: "greet"
  }

  greet(event) {
    console.log("Got click event: ", event);
    alert("Hello world!")
  }
}

HelloWorldElement.register();

<hello-world></hello-world>

Included components

In addition to the abstract sprinkles element, we also include some basic elements that you can use.

ClickableCard

A card that can be clicked anywhere to follow the link inside it:

import { ClickableCard } from "sprinkles-js";

ClickableCard.register();
<clickable-card>
  <p>Some text</p>
  </p>

  <a href="https://example.com" data-clickable-card-ref="link">A link</a>

  <button>A button that doesn't trigger</button>
</clickable-card>

This library was extracted from various projects at Tree company.

Tree company