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

slidev-addon-mouse-trail-pen

v2.1.0

Published

A beautiful mouse trail pen effect addon for Slidev presentations

Readme

Slidev Addon: Mouse Trail Pen

A beautiful mouse trail pen effect addon for Slidev presentations that creates smooth, animated pen-like trails following your cursor.

Features

  • 🎨 Smooth Animation: Bezier curves for natural movement
  • 🌈 Gradient Effect: Beautiful color transitions
  • Performance Optimized: Uses requestAnimationFrame
  • 🎯 Auto Fade: Trail points disappear naturally
  • 🔧 Zero Configuration: Works out of the box
  • 📱 Responsive: Adapts to window resizing

Installation

npm install slidev-addon-mouse-trail-pen

Usage

Add the addon to your Slidev presentation frontmatter:

---
addons:
  - slidev-addon-mouse-trail-pen
---

That's it! The mouse trail effect will be active across all slides in your presentation.

How It Works

The addon automatically:

  1. Creates a canvas overlay covering the entire screen
  2. Tracks mouse movement and stores trail points
  3. Renders smooth curves using quadratic bezier curves
  4. Applies gradients for visual appeal
  5. Manages performance by limiting trail points and using efficient rendering

Technical Details

  • Canvas-based rendering for smooth performance
  • Fixed positioning to cover entire viewport
  • Pointer events disabled so it doesn't interfere with interactions
  • Automatic cleanup when navigating away
  • Responsive design adapts to window resizing

Configuration

Global Configuration (Frontmatter)

Configure the mouse trail globally in your Slidev frontmatter:

---
theme: default
addons:
  - slidev-addon-mouse-trail-pen
mouseTrailPen:
  preset: ink
  maxPoints: 80
  lineWidth: 5
  fadeDuration: 1500
  enabled: true
---

Using Color Presets

Add a preset color to any slide by including a div with the data-mouse-trail-preset attribute:

<div data-mouse-trail-preset="rainbow"></div>

Available Presets:

  • blue - Classic blue trail (default)
  • green - Vibrant green
  • purple - Royal purple
  • red - Bold red
  • orange - Warm orange
  • pink - Bright pink
  • rainbow - Multi-color rainbow
  • fire - Orange-red fire effect
  • ocean - Blue ocean depths
  • ink - Classic black and white ink pen

Custom Configuration

For advanced customization, use the data-mouse-trail-config attribute with JSON:

<div data-mouse-trail-config='{"maxPoints": 80, "lineWidth": 5, "fadeDuration": 1500, "colors": ["rgba(255, 0, 255, 0)", "rgba(0, 255, 255, 0.8)", "rgba(255, 255, 0, 1)"]}'></div>

Configuration Options:

  • preset - Color preset name (blue, green, purple, red, orange, pink, rainbow, fire, ocean, ink)
  • maxPoints - Number of trail points (default: 50)
  • fadeDuration - How long trails last in ms (default: 1000)
  • lineWidth - Thickness of the trail (default: 3)
  • colors - Array of RGBA colors for gradient (default: blue gradient)
  • enabled - Enable/disable the effect (default: true)

Examples

Global Ink Trail:

---
addons:
  - slidev-addon-mouse-trail-pen
mouseTrailPen:
  preset: ink
  lineWidth: 4
---

Per-slide Green Trail:

# My Slide
<div data-mouse-trail-preset="green"></div>
Content here...

Custom Purple-to-Gold:

# My Slide
<div data-mouse-trail-config='{"colors": ["rgba(147, 51, 234, 0)", "rgba(234, 179, 8, 1)"]}'></div>
Content here...

Disable on Specific Slide:

---
mouseTrailPen:
  enabled: false
---

Development

To develop this addon locally:

# Clone the repository
git clone https://github.com/zillionare/slidev-addon-mouse-trail-pen
cd slidev-addon-mouse-trail-pen

# Install dependencies
npm install

# Run the example
npm run dev

License

MIT

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.