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

blur-reveal-input

v1.0.0

Published

Password input with blur effect that can be selectively revealed

Readme

blur-reveal-input

Replace boring password dots with a beautiful blur effect. Hover or touch to reveal.

Zero dependencies. Works everywhere — vanilla JS, React, Vue, Angular, Svelte, or a simple <script> tag.

npm version bundle size license

Live Demo

Demo


What is this?

Standard password fields show ••••••••. This library shows your password text behind a CSS blur — move your mouse or finger across to reveal it through a clear window. When you stop, it fades back to blurred.

  • Desktop: Hover to reveal, characters stay visible as you move across, smooth fade-out when you leave
  • Mobile: Touch and drag to reveal, fades back after lifting your finger
  • Accessible: Respects prefers-reduced-motion, works with screen readers, supports high contrast mode

Install

npm / yarn / pnpm / bun

npm install blur-reveal-input

CDN (no build step)

<script src="https://unpkg.com/blur-reveal-input"></script>

or

<script src="https://cdn.jsdelivr.net/npm/blur-reveal-input"></script>

That's it — all <input type="password"> fields on the page are automatically enhanced.

Usage

Drop-in (CDN / script tag)

Just include the script. Every password input on the page gets the blur effect automatically:

<input type="password" placeholder="Enter password">
<script src="https://unpkg.com/blur-reveal-input"></script>

Opt out a specific input:

<input type="password" data-blur-reveal="false" placeholder="Normal password">

ES Module (bundlers)

import { BlurRevealInput } from 'blur-reveal-input';

const input = document.querySelector('input[type="password"]');
const blur = new BlurRevealInput(input);

// Later: clean up
blur.destroy();

React

import { useEffect, useRef } from 'react';
import { BlurRevealInput } from 'blur-reveal-input';

function PasswordField() {
  const inputRef = useRef(null);

  useEffect(() => {
    const blur = new BlurRevealInput(inputRef.current);
    return () => blur.destroy();
  }, []);

  return <input ref={inputRef} type="password" placeholder="Password" />;
}

Vue

<template>
  <input ref="passwordInput" type="password" placeholder="Password" />
</template>

<script setup>
import { ref, onMounted, onBeforeUnmount } from 'vue';
import { BlurRevealInput } from 'blur-reveal-input';

const passwordInput = ref(null);
let blur;

onMounted(() => {
  blur = new BlurRevealInput(passwordInput.value);
});

onBeforeUnmount(() => {
  blur?.destroy();
});
</script>

Angular

import { Component, ElementRef, ViewChild, AfterViewInit, OnDestroy } from '@angular/core';
import { BlurRevealInput } from 'blur-reveal-input';

@Component({
  selector: 'app-password',
  template: `<input #passwordInput type="password" placeholder="Password" />`
})
export class PasswordComponent implements AfterViewInit, OnDestroy {
  @ViewChild('passwordInput') inputRef!: ElementRef<HTMLInputElement>;
  private blur?: BlurRevealInput;

  ngAfterViewInit() {
    this.blur = new BlurRevealInput(this.inputRef.nativeElement);
  }

  ngOnDestroy() {
    this.blur?.destroy();
  }
}

Svelte

<script>
  import { onMount } from 'svelte';
  import { BlurRevealInput } from 'blur-reveal-input';

  let inputEl;

  onMount(() => {
    const blur = new BlurRevealInput(inputEl);
    return () => blur.destroy();
  });
</script>

<input bind:this={inputEl} type="password" placeholder="Password" />

WordPress

Install the Blur Reveal Input plugin — upload the zip through Plugins > Add New > Upload Plugin, activate, and every password field on your site gets the blur effect automatically. Includes a settings page with live preview.

Or just enqueue the script in your theme's functions.php:

function my_blur_reveal() {
    wp_enqueue_script(
        'blur-reveal-input',
        'https://unpkg.com/blur-reveal-input',
        array(),
        '1.0.0',
        true
    );
}
add_action( 'wp_enqueue_scripts', 'my_blur_reveal' );

Shopify

Add to your theme.liquid before </body>:

<script src="https://unpkg.com/blur-reveal-input"></script>

All password inputs in your store (login, registration, checkout) are automatically enhanced.

Apply to all password inputs

import { BlurRevealInput } from 'blur-reveal-input';

// Enhance every password input on the page
const instances = BlurRevealInput.applyToAll();

// Clean up all
instances.forEach(i => i.destroy());

Configuration

const blur = new BlurRevealInput(input, {
  blurIntensity: 4,    // Blur strength in px (default: 4)
  revealRadius: 30,    // Reveal window size in px (default: 30, mobile: 40)
  fadeDelay: 500,       // ms before fade-out starts (default: 500)
  fadeDuration: 300,    // ms for fade-out animation (default: 300)
  enabled: true,        // Enable/disable (default: true)
});

// Update at runtime
blur.updateConfig({ blurIntensity: 6, fadeDelay: 1000 });

// Toggle
blur.disable();
blur.enable();

Data attributes (no JS needed with CDN)

<input type="password"
  data-blur-intensity="6"
  data-reveal-radius="40"
  data-fade-delay="1000"
>

Events

input.addEventListener('blur-reveal:reveal', (e) => {
  console.log('Revealing at', e.detail.x, e.detail.y);
});

input.addEventListener('blur-reveal:hide', () => {
  console.log('Hidden');
});

input.addEventListener('blur-reveal:init', () => {
  console.log('Initialized');
});

input.addEventListener('blur-reveal:destroy', () => {
  console.log('Destroyed');
});

CSS Custom Properties

Override these to customize the look:

.blur-reveal-container {
  --blur-reveal-intensity: 4px;
  --blur-reveal-radius: 30px;
  --blur-reveal-font: 'Your Mono Font', monospace;
}

Browser Support

Works in all modern browsers that support CSS filter: blur() and mask-image:

  • Chrome 76+
  • Firefox 53+
  • Safari 15.4+
  • Edge 79+
  • iOS Safari 15.4+
  • Chrome for Android 76+

How it works

  1. Wraps your <input type="password"> in a container
  2. Creates two overlays: one permanently blurred, one clear with a CSS mask
  3. The input text is made transparent (caret stays visible)
  4. On hover/touch, the clear overlay's mask follows your cursor, revealing text through the blur
  5. When you leave, the clear overlay fades out smoothly using requestAnimationFrame

The actual password value never leaves the input element. This is purely a visual effect.

Author

Arik ShalitoGitHub

License

MIT