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

glass-refraction

v0.1.0

Published

Liquid Glass design system — CSS + React components with SVG refraction, specular highlights, and chromatic edge dispersion

Readme

glass-refraction

Liquid Glass design system — CSS + React components with SVG refraction filters, specular highlights, and chromatic edge dispersion.

npm License: MIT

Inspired by Apple's Liquid Glass (WWDC 2025) and kube.io SVG refraction research.


Install

npm install glass-refraction

CSS-only usage (any framework)

Import the stylesheet and use the class names directly:

@import 'glass-refraction/css';

Or in JavaScript/TypeScript:

import 'glass-refraction/css';
<nav class="glass">Navbar</nav>
<div class="glass-card">Content card</div>
<span class="glass-pill">Badge</span>

React usage

import { GlassFilters, Glass, GlassCard, GlassPill } from 'glass-refraction';

export default function App() {
  return (
    <>
      <GlassFilters />
      <Glass as="nav" className="px-4 py-3">Navbar</Glass>
      <GlassCard className="p-6">
        <h2>Card title</h2>
        <p>Card content</p>
      </GlassCard>
      <GlassPill className="px-3 py-1">Tag</GlassPill>
    </>
  );
}

React components automatically import the CSS.


Tiers

| Class | Use case | Effect | |---|---|---| | .glass | Navbar, footer, hero overlays | Dense frosted glass with animated shimmer sweep, specular breathing highlight, and full chromatic edge dispersion | | .glass-card | Content cards, panels | Medium-density glass with hover lift, top-edge specular line, and chromatic edges on hover | | .glass-pill | Tags, badges, inline elements | Lightweight frosted pill with subtle hover brighten |

React Components

<GlassFilters />

Renders hidden SVG <defs> providing two refraction filters. Place once near the root of your app.

| Prop | Type | Default | Description | |---|---|---|---| | scale | number | 8 | Displacement scale for subtle refraction | | strongScale | number | 16 | Displacement scale for strong refraction | | baseFrequency | string | "0.015 0.012" | Turbulence frequency | | numOctaves | number | 2 | Noise octaves | | seed | number | 42 | Turbulence seed |

Apply the filters in CSS:

.refracted { filter: url(#glass-refract); }
.refracted-strong { filter: url(#glass-refract-strong); }

<Glass>

Polymorphic wrapper rendering a .glass element.

| Prop | Type | Default | Description | |---|---|---|---| | as | ElementType | "div" | HTML element to render | | variant | "glass" \| "glass-card" \| "glass-pill" | "glass" | Override the tier | | className | string | — | Additional classes |

<GlassCard>

| Prop | Type | Default | Description | |---|---|---|---| | as | ElementType | "div" | HTML element to render | | hoverable | boolean | true | Enable hover lift effect | | className | string | — | Additional classes |

<GlassPill>

| Prop | Type | Default | Description | |---|---|---|---| | as | ElementType | "span" | HTML element to render | | className | string | — | Additional classes |


Theming

Override CSS custom properties to theme the glass system:

:root {
  /* Blur */
  --gr-blur: 26px;
  --gr-blur-card: 20px;
  --gr-blur-pill: 8px;

  /* Saturation */
  --gr-saturation: 1.7;
  --gr-saturation-card: 1.5;
  --gr-saturation-pill: 1.3;

  /* Border radius */
  --gr-radius: 20px;
  --gr-radius-card: 16px;
  --gr-radius-pill: 9999px;

  /* Base background */
  --gr-bg-start: rgba(18, 22, 35, 0.48);
  --gr-bg-end: rgba(12, 16, 28, 0.42);

  /* Chromatic dispersion */
  --gr-chromatic-blue: rgba(0, 180, 255, 0.045);
  --gr-chromatic-violet: rgba(120, 80, 255, 0.04);
  --gr-chromatic-pink: rgba(255, 100, 200, 0.035);
  --gr-chromatic-green: rgba(100, 255, 180, 0.025);

  /* Animation timing */
  --gr-shimmer-duration: 7s;
  --gr-specular-duration: 5s;
}

Examples

Browser Support

Requires backdrop-filter support:

  • Chrome 76+
  • Safari 9+ (with -webkit- prefix, included)
  • Firefox 103+
  • Edge 79+

SVG refraction filters (<GlassFilters />) work in all modern browsers.

Credits

  • Apple Liquid Glass design language (WWDC 2025)
  • kube.io SVG refraction research
  • feTurbulence + feDisplacementMap technique

License

MIT