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

@specy/liquid-glass

v1.12.1

Published

A Three.js powered library to make apple's liquid with glass effect

Readme

@specy/liquid-glass

An apple styled liquid glass effect for the web.

Installation

npm install @specy/liquid-glass

Basic Usage

import { LiquidGlass } from '@specy/liquid-glass';

// Create a glass effect on an element
const glassEffect = new LiquidGlass(
  document.body, // Target element
  {
    // html2canvas options for screenshot
    allowTaint: true,
    useCORS: true,
    scale: 1,
  },
  `
    /* Custom CSS for the glass container */
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 1rem 2rem;
    border-radius: 16px;
  `,
  {
    // Glass style options
    radius: 16,
    roughness: 0.2,
    transmission: 1,
    ior: 1.5,
    thickness: 32,
  }
);

// Add the glass effect to the DOM
document.body.appendChild(glassEffect.element);

// Add content to the glass container
const content = document.createElement('div');
content.innerHTML = '<h1>Hello, Glass World!</h1>';
glassEffect.content.appendChild(content);

API Reference

LiquidGlass

The main class for creating glass effects.

Constructor

new LiquidGlass(
  targetElement: HTMLElement,
  screenshotOptions?: Partial<Options>,
  customStyle?: string,
  glassStyle?: GlassStyle
)

Parameters:

  • targetElement: The HTML element to capture for the background effect
  • screenshotOptions: Options for html2canvas screenshot capture
  • customStyle: Custom CSS styles for the glass container
  • glassStyle: Glass material properties

Glass Style Options

interface GlassStyle {
  depth?: number;      // Geometry depth (default: 32)
  segments?: number;   // Geometry segments (default: 32)
  radius?: number;     // Border radius (default: 16)
  tint?: number | null; // Glass tint color (default: null)
  roughness?: number;  // Surface roughness 0-1 (default: 0.3)
  transmission?: number; // Light transmission 0-1 (default: 1)
  ior?: number;        // Index of refraction (default: 2)
  thickness?: number;  // Glass thickness (default: 64)
}

Properties

  • element: The main glass container element
  • content: The content container element for adding child elements

Methods

  • destroy(): Clean up and remove the glass effect

PillGeometry

Custom Three.js geometry for creating pill-shaped (rounded rectangle) objects.

import { PillGeometry } from '@specy/liquid-glass';

const geometry = new PillGeometry(width, height, depth, segments, radius);

takeElementScreenshot

Utility function for taking screenshots of DOM elements.

import { takeElementScreenshot } from '@specy/liquid-glass';

const canvas = await takeElementScreenshot(element, {
  allowTaint: true,
  useCORS: true,
  scale: 1
});

Development

To build the package locally:

npm install
npm run build

To watch for changes during development:

npm run build:watch

License

MIT

Contributing

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