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

@arthur_leywin/glass-ui

v0.1.1

Published

A premium, interactive React component library implementing physics-based 3D WebGL glass materials, real-time refraction/distortion, spring micro-interactions, layout indicators, and kinetic SVG animations.

Readme

@arthur_leywin/glass-ui

A premium, interactive React component library implementing physics-based 3D WebGL glass materials, real-time refraction/distortion, spring micro-interactions, layout indicators, and kinetic SVG animations.

Designed to deliver rich, state-of-the-art aesthetics while maintaining high-performance safety rails (touchscreen fallbacks, prefers-reduced-motion integration, and viewport lazy-mounting).


Key Features

  • Split Entry Points (Zero WebGL Bloat): Exposes two separate package subpaths. Lightweight components import instantly without loading Three.js.
  • Real-Time WebGL Glass Refraction (Opt-In): Dynamic 3D refraction maps, chromatic aberration, point-light cursor tracking, and surface roughness rendering powered by React Three Fiber and Three.js.
  • Adaptive Performance Engine:
    • Coarse Pointer & Viewport Detection: Automatically detects mobile/touchscreens and viewports under 768px, falling back to static CSS glass configurations to save power.
    • Reduced Motion Support: Disables spring magnetic follow, 3D hover tilt, and heavy shader materials when system prefers-reduced-motion is active.
    • Viewport Lazy Mounting: Automatically skips WebGL Canvas rendering for off-screen cards using IntersectionObserver, activating canvas contexts only as they enter the viewport.
    • Animation Count Threshold: Emits console warnings in development mode when more than 10 anime.js micro-animations are active simultaneously to prevent frames dropping.
  • Spring-Physics Core Widgets: Magnetic hover buttons, elastic tooltips with automatic screen flipping, and layouts using GSAP/Framer Motion.
  • Kinetic Micro-Animations: Sequential typewriter writing, decode scrambling, SVG path morphing, logo-reveal path separators, and responsive loading animations.

Installation

Install the library along with its peer dependencies:

npm install @arthur_leywin/glass-ui three @react-three/fiber @react-three/drei framer-motion gsap animejs

Import Subpaths

To support maximum tree-shaking efficacy, @arthur_leywin/glass-ui exports assets on two different paths:

1. Lightweight Components (@arthur_leywin/glass-ui)

Contains core widgets with zero WebGL or Three.js dependencies. Perfect for maintaining small bundle sizes.

  • Components: Badge, Tooltip, Input, Select, Checkbox, Radio, Switch, Tabs, Navbar, AnimatedText, AnimatedIcon, PathDivider, Loader, Card, Button.
  • Note: Card, Button, and Loader rendered from this path use high-performance static CSS glass styling.
import { Badge, Tooltip, Input, Button, Card } from "@arthur_leywin/glass-ui";

2. WebGL Components (@arthur_leywin/glass-ui/webgl)

Exposes premium 3D shader-based components that pull in Three.js and React Three Fiber.

  • Components: GlassCanvas, GlassButton, GlassCard, GlassLoader, and material shader definitions.
import { GlassCard, GlassButton, GlassLoader, GlassCanvas } from "@arthur_leywin/glass-ui/webgl";

Quick Start

1. Basic Setup

Import the global styles into your project root (e.g. main.tsx or _app.tsx):

import "@arthur_leywin/glass-ui/dist/index.css";

2. Render an Interactive WebGL Glass Card

import { GlassCard } from "@arthur_leywin/glass-ui/webgl";

export default function App() {
  return (
    <GlassCard 
      tilt={true} 
      tiltMaxAngle={12}
      glassProps={{
        ior: 1.5,
        chromaticAberration: 0.05,
        roughness: 0.15,
        thickness: 1.2
      }}
    >
      <div className="p-8">
        <h3 className="text-xl font-bold text-white">Glass Interface</h3>
        <p className="text-sm text-neutral-300">
          This card bends background colors dynamically based on pointer positions.
        </p>
      </div>
    </GlassCard>
  );
}

Component Reference

1. Card & GlassCard

A customizable glass backplate with mouse-tilt reflection, glare, and background shader properties.

| Prop (GlassCard) | Type | Default | Description | |---|---|---|---| | tilt | boolean | true | Enables 3D cursor-follow perspective tilt. | | tiltMaxAngle| number | 12 | Maximum tilt inclination in degrees. | | showOrbs | boolean | true | Renders moving gradient orbs behind the glass plate inside the shader scene. | | glassProps | GlassMaterialProps | {} | Customize IOR, chromatic aberration, roughness, and thickness. |


2. Button & GlassButton

Magnetic spring buttons featuring cursor light tracking.

import { GlassButton } from "@arthur_leywin/glass-ui/webgl";

<GlassButton magnetic={true} magneticStrength={0.4}>
  Confirm Transaction
</GlassButton>

3. Tooltip

Spring-physics tooltip indicators that automatically flip coordinates if pushed off-screen.

import { Tooltip, Button } from "@arthur_leywin/glass-ui";

<Tooltip content="Saves changes immediately" position="top">
  <Button variant="ghost">Save Draft</Button>
</Tooltip>

4. Form Elements

CSS glass form fields mapped to project design tokens:

import { Input, Select, Switch, Checkbox, Radio } from "@arthur_leywin/glass-ui";

// Inside a form container:
<Input label="Email" type="email" placeholder="enter email..." />
<Select 
  label="Region" 
  options={[{ value: "us", label: "US" }, { value: "eu", label: "EU" }]} 
/>
<Switch label="Developer Mode" checked={dev} onChange={setDev} />

5. Dialogs (Modal & Drawer)

A11y-compliant modal popups and drawers incorporating GSAP entry tweens, backdrop clicks, and keyboard focus trap boundaries.

import { Modal, Drawer } from "@arthur_leywin/glass-ui";

// Modal Popup
<Modal isOpen={isOpen} onClose={() => setIsOpen(false)} title="Confirmation">
  <p className="text-sm">Proceed with changes?</p>
</Modal>

License

MIT · Made by @arthur_leywin