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

shake-editor

v0.1.0

Published

Framework-agnostic power-mode particles and shake effects for text editors, with React, Vue, and Web Component adapters.

Downloads

58

Readme

shake-editor

Power-mode particles and subtle shake feedback for text inputs, textareas, and contenteditable editors. Built with Vite and shipped as one dependency with first-class vanilla, React, Vue, and Web Component entry points.

The effect is lazy, SSR-friendly in the core/framework entry points, high-DPI aware, capped at 500 particles, and automatically respects prefers-reduced-motion.

Install

npm install shake-editor

React and Vue are optional peer dependencies, so vanilla and Web Component users do not download a framework.

Vanilla

import { createShakeEditor } from 'shake-editor';

const editor = document.querySelector<HTMLElement>('#editor')!;
const shake = createShakeEditor(editor, {
  colors: ['#ff4d8d', '#ffcc33', '#43e8d8'],
  particles: { count: [8, 16], size: 3 },
  shake: { intensity: 2.5, duration: 90 },
});

// Optional imperative controls
shake.burst();
shake.update({ shake: false });
shake.destroy();

The target can be the editable element itself or a wrapper containing several editable descendants.

React

import { ShakeEditor } from 'shake-editor/react';

export function Editor() {
  return (
    <ShakeEditor
      className="editor-shell"
      options={{ colors: ['#ff4d8d', '#ffcc33', '#43e8d8'] }}
    >
      <textarea defaultValue="Start typing…" />
    </ShakeEditor>
  );
}

ShakeEditor forwards its ref and all normal <div> attributes to the wrapper.

Vue

<script setup lang="ts">
import { ShakeEditor } from 'shake-editor/vue';
</script>

<template>
  <ShakeEditor :options="{ colors: ['#ff4d8d', '#ffcc33', '#43e8d8'] }">
    <textarea value="Start typing…" />
  </ShakeEditor>
</template>

Web Component

Importing the entry registers <shake-editor> automatically:

<script type="module">
  import 'shake-editor/web-component';
</script>

<shake-editor
  colors="#ff4d8d, #ffcc33, #43e8d8"
  particle-count="12"
  shake-intensity="2.5"
>
  <textarea>Start typing…</textarea>
</shake-editor>

Available attributes are colors, particle-count, particle-size, shake, shake-duration, shake-intensity, and respect-reduced-motion. Use shake="false" to disable shaking. For full configuration, assign the typed options property.

If automatic registration is undesirable, import defineShakeEditor and call it with a custom tag name.

Options

interface ShakeEditorOptions {
  particles?: {
    count?: number | readonly [number, number]; // default: [8, 14]
    size?: number;                              // default: 3
    gravity?: number;                           // default: 0.075
    decay?: number;                             // default: 0.96
    spread?: number;                            // default: 1
    velocity?: number;                          // default: 3.5
  };
  shake?: false | {
    intensity?: number; // default: 2.5
    duration?: number;  // default: 90
  };
  colors?: 'auto' | readonly string[];
  respectReducedMotion?: boolean; // default: true
  zIndex?: number;                // default: 2147483647
}

With colors: 'auto', particles inherit the computed text color at the caret. The canvas has pointer-events: none and is removed by destroy() or framework unmount.

Develop and publish

npm install
npm run dev      # local playground
npm run check    # typecheck, tests, production build
npm pack --dry-run
npm publish

The package publishes ESM and CommonJS builds plus declarations for all four export paths.

License

MIT