xpr-custom-cursor

A small package to help with adding custom cursors to a page.

Usage no npm install needed!

<script type="module">
  import xprCustomCursor from 'https://cdn.skypack.dev/xpr-custom-cursor';
</script>

README

XPR Custom Cursor

How to use:

Install & require:

$ npm i xpr-custom-cursor --save
var XPRCustomCursor = require('xpr-custom-cursor');

Init:

// optional container el. if no container is specified, it will append to the body.
var container = document.querySelector(...); 

// optional opts, but markup is probably necessary ;)
var opts = {
  markup: '<span>custom cursor!</span>',
  styles: {
    color: 'red'
  }
}

var cursor = new XPRCustomCursor(container, opts);

Important: You'll have to style the inner markup yourself via classes or something. Also, if you're using Browserify, install browsernizr! :)