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 🙏

© 2026 – Pkg Stats / Ryan Hefner

cursorwith-ts

v1.1.5

Published

A tiny, customizable, easy-to-use, framework-Agnostic, and high performance cursor following effect.

Readme

cursorwith-ts


🔥 Features

  • Tiny: ~7 kB (gzipped) output
  • Zero runtime dependencies
  • Complete TypeScript declarations
  • Works with any framework (Vue / React / Svelte / Vanilla ...)
  • Smooth animation via Canvas (no layout thrash / minimal main thread impact)
  • Configurable follow strategies (e.g. time-based)

🎈 Tiny

Just ≈ 7 kB. Import, instantiate, done.

import { CreateCursorWith } from 'cursorwith-ts/core'; // ~7 kB gzipped

🚀 Zero-Dependency

No third-party libraries are required; all functionality is implemented internally, minimizing project complexity.

🔒 TypeScript Support

Written entirely in TypeScript across the stack, complete with type definitions to enhance development safety.

import type { CursorWithOptions } from 'cursorwith-ts/types';

🍭 Framework-Agnostic

Pure implementation – drop it into Vue, React, Angular, Svelte, Solid or plain HTML.

Vue Example (App.vue)

import { CreateCursorWith } from 'cursorwith-ts/core';
import { follow } from 'cursorwith-ts/use';
import { onMounted, onBeforeUnmount, ref } from 'vue';

const cursorWith = ref<InstanceType<typeof CreateCursorWith> | null>(null);
onMounted(() => {
  cursorWith.value = new CreateCursorWith({
    style: { 
      radius: 10, 
      color: 'rgba(0,0,0,0.1)', 
      borderWidth: 1, 
      borderColor: 'rgba(0,0,0,1)' 
    }
  });
  cursorWith.value.use(follow({ type: 'time', timeRatio: 0.04 }));
});
onBeforeUnmount(() => {
  cursorWith.value?.destroy();
});

React Example (App.tsx)

import { useEffect, useRef } from 'react';
import { CreateCursorWith } from 'cursorwith-ts/core';
import { follow } from 'cursorwith-ts/use';

export default function App() {
  const cursorRef = useRef<InstanceType<typeof CreateCursorWith> | null>(null);

  useEffect(() => {
    cursorRef.current = new CreateCursorWith({
      style: { 
        radius: 10, 
        color: 'rgba(0,0,0,0.1)', 
        borderWidth: 1, 
        borderColor: 'rgba(0,0,0,1)' 
      }
    });
    cursorRef.current.use(follow({ type: 'time', timeRatio: 0.04 }));

    return () => {
      cursorRef.current?.destroy();
    };
  }, []);

  return <></>;
}

⚡️ High Performance

Canvas-based rendering only. No layout / reflow thrashing; minimal overhead per frame.

📦 Install

# npm
npm install cursorwith-ts

# pnpm
pnpm add cursorwith-ts

# yarn
yarn add cursorwith-ts

Usage

[!TIP] cursorwith-ts only supports ESM (native modules) and CDN usage.

ES6 Modules

import { CreateCursorWith } from 'cursorwith-ts/core';
import { follow } from 'cursorwith-ts/use';

const cw = new CreateCursorWith({
  style: { 
    radius: 10, 
    color: 'rgba(0,0,0,0.1)', 
    borderWidth: 1, 
    borderColor: '#000000' 
  }
});
cw.use(follow({ 
  type: 'time', 
  timeRatio: 0.04 
}));

// Hover effect (recommended to set containers)
// const container = document.body;
// const cw = new CreateCursorWith({ style: { radius: 12, color: '#00000022' }, container });
// cw.use(hoverEffect({ scope: { class: ['demo'] }, padding: 10, container }));

CDN (unpkg)

<script type="module">
  import { CreateCursorWith, follow } from 'https://unpkg.com/cursorwith-ts@latest/dist/index.js';
  const cw = new CreateCursorWith({
    style: { radius: 10, color: 'rgba(0,0,0,0.1)', borderWidth: 1, borderColor: '#000000' }
  });
  cw.use(follow({ type: 'time', timeRatio: 0.04 }));
</script>

TypeScript Support

cursorwith-ts ships full declaration files – no extra config needed.

import { CreateCursorWith } from 'cursorwith-ts/core';
import type { CursorWithOptions } from 'cursorwith-ts/types';
import { follow } from 'cursorwith-ts/use';

const options: CursorWithOptions = {
  style: { 
    radius: 10, 
    color: 'rgba(0,0,0,0.1)', 
    borderWidth: 1, 
    borderColor: '#000000' 
  }
};
const cw = new CreateCursorWith(options);
cw.use(follow({ type: 'time', timeRatio: 0.04 }));

🌍 Environment Requirements

  • Modern browsers supporting ES modules & Canvas

⚙️ Minimal API (Quick Reference)

import { CreateCursorWith } from 'cursorwith-ts/core';
import { follow } from 'cursorwith-ts/use';

const instance = new CreateCursorWith({
  style: { radius: 10, color: 'rgba(0,0,0,0.1)' }
});
instance.use(follow({ type: 'time', timeRatio: 0.04 }));

// Later
instance.destroy();

| Option Path | Type / Values | Description | |------------------------|-------------------------------|-------------------------------------| | style.radius | number | Circle radius in px | | style.color | string (CSS color) | Fill color | | style.borderWidth | number | Border stroke width | | style.borderColor | string | Border stroke color | | follow.type | 'time' | 'gap' (example) | Follow strategy mode | | follow.timeRatio | number | Time easing factor (for time mode) | | ... | ... | ... |

For full option details see the documentation

🤝 Contributing

PRs welcome. Please run lint & build before submitting:

pnpm lint && pnpm build

📄 License

MIT © 2025-present

📝 Changelog

See CHANGELOG