click-spark

A web component that adds a little spark to your clicks


License
MIT
Install
npm install click-spark@2.0.3

Documentation

click-spark

Add a little spark to your clicks. ✨

CodePen demo | Blog post

Install

npm install click-spark

Or you can download the click-spark.js file from this repo and add it to your project.

Usage

Add the custom element wherever we want to see sparks fly.

<script type="module" src="click-spark.js"></script>

<body>
  <!-- only add sparks within this container -->
  <div class="container">
    <click-spark></click-spark>
  </div>

  <!-- sparks appear everywhere we click -->
  <click-spark></click-spark>
</body>

Change spark color

Set a spark color via CSS custom property:

<click-spark style="--click-spark-color: blue"></click-spark>