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

@khoivudev/liquid-glass-react

v1.0.13

Published

A lightweight React component that creates a "Liquid Glass" distortion effect using CSS backdrop-filter and SVG feDisplacementMap.

Readme

Liquid Glass React

@khoivudev/liquid-glass-react

A lightweight React component that creates a "Liquid Glass" distortion effect using CSS backdrop-filter and SVG feDisplacementMap.

Liquid Glass Demo

Installation

npm install @khoivudev/liquid-glass-react

Note: This package no longer requires three or @react-three/fiber.

Usage

Simply wrap your content with <LiquidGlass>. It acts like a div but applies the liquid distortion to the background behind it.

Important: This uses backdrop-filter, so the effect applies to what is behind the element.

import { LiquidGlass } from "@khoivudev/liquid-glass-react";

function App() {
  return (
    <div
      style={{
        backgroundImage: "url(https://picsum.photos/1600/900)",
        backgroundSize: "cover",
        backgroundPosition: "center",
        height: "100vh",
        display: "flex",
        justifyContent: "center",
        alignItems: "center",
      }}
    >
      <LiquidGlass>{/* Your Content */}</LiquidGlass>
    </div>
  );
}

Props

| Prop | Type | Default | Description | | -------------------- | ------------------------- | ------- | --------------------------------------------------------------------- | | glassThickness | number | MotionValue | 50 | Thickness of the glass effect. Controls displacement amount. | | bezelWidth | number | MotionValue | 15 | Width of the edge bezel where refraction occurs. | | blur | number | MotionValue | 0.9 | Standard deviation for Gaussian blur on the source graphic. | | refractiveIndex | number | MotionValue | 1.5 | Refractive index (IOR). Glass is ~1.5, Water ~1.33. | | specularOpacity | number | MotionValue | 1.5 | Opacity of the specular highlights (0.0 - 1.0). | | specularSaturation | number | MotionValue | 4 | Saturation boost for the refracted area. | | dpr | number | MotionValue | 1 | Device Pixel Ratio. Defaults to window.devicePixelRatio if undefined. | | className | string | - | CSS classes to apply to the wrapper div. | | style | CSSProperties | - | Inline styles for the wrapper div. | | children | ReactNode | - | Content inside the glass container. |

Browser Support

Relies on backdrop-filter: url(...).

  • Chrome/Edge: Good support.
  • Firefox/Safari: Experimental/Limited support. May require flags or fallback to standard blur.

How it Works

  1. Physical Simulation: Calculates a refraction profile based on bezel geometry (thickness, width, curve) and refractive index (Snell's Law).
  2. Displacement Map: Generates a displacement map on a 2D Canvas based on the calculated profile.
  3. SVG Filter: Creates an invisible SVG <filter> using <feDisplacementMap> to distort the background and a custom specular layer for highlights.
  4. CSS Application: Applies the filter to the component via CSS backdrop-filter.