Skip to content

About

Liquid Glass - Heavily Optimised

Topics

Resources

Stars

404 stars

Watchers

2 watching

Forks

Repository files navigation

QuickLiquid — Ultra-fast liquid glass for React and the web

npm version npm total downloads TypeScript types zero dependencies Live site license

Ultra-fast refractive liquid glass for React and vanilla JavaScript.
Precomputed Snell LUT optics, chromatic dispersion, 1×–3× magnification, SDF metaball merging, and spring-driven UI primitives.

Live Site · Interactive Playground · API Docs · Agent Skill · Physics Notes · npm

Live QuickLiquid lens refracting the wordmark and spectral light field with chromatic edges

Visual Showcase

Snell refraction, chromatic dispersion, and 2.2x optical zoom
Optics, Dispersion & 1×–3× Zoom — Vector Snell bezels, shared-map RGB prism rims, and optical magnification.

All six material presets: clear, thin, regular, thick, ultra, and adaptive
6 Curated Material Presets — clear, thin, regular, thick, ultra, and adaptive tuned out of the box.

Five render quality tiers from low 0.5x to extreme 3x
5 Quality Tiers (QUALITY_PRESETS) — Scale from lightweight 0.5× controls up to 3× supersampled hero optics.

React UI primitives: navbar, Spectrum console, LiquidToggle, and command palette
React UI Primitives — LiquidGlassButton, LiquidSegmented, LiquidToggle, LiquidSwitcher, and useLiquidFlow.

Spring-driven segmented pill, liquid toggle stretch, and ripple button
Analytical Spring Physics — Bounded jelly pills, droplet switch stretch, water ripples, and scroll tracking.

SDF metaball droplet merging between two refractive glass drops
SDF Metaball Merging (LiquidGroup) — Continuous smooth-min glass bridges and specular rims as droplets meet.


Install

npm install quick-liquid

Zero runtime dependencies · Node 18+ · React 18+ optional for quick-liquid/react.

Agent Skill

Install the QuickLiquid skill in your website project to give your coding agent integration examples, material and optics guidance, motion patterns, and browser diagnostics.

npx skills add amarnath3003/quickLiquid --skill quick-liquid

After installing, try this prompt in your coding agent.

Use $quick-liquid to add a frosted navigation bar to this website.

From a local clone, use npx skills add . --skill quick-liquid. View on skills.sh · Read the skill source.

Quick Start

React

import { LiquidGlass } from 'quick-liquid/react';

export function GlassCard() {
  return (
    <LiquidGlass
      config={{
        material: 'clear',
        appearance: 'dark',
        quality: 'high',
        refractionStrength: 32,
        chromaticAberration: 0.24,
      }}
      liquidPress
    >
      <div className="card">Hello, glass.</div>
    </LiquidGlass>
  );
}

Vanilla DOM

import { LiquidGlassEngine } from 'quick-liquid';

const card = document.querySelector<HTMLElement>('.card');

if (card) {
  const glass = new LiquidGlassEngine(card, {
    material: 'clear',
    refractionStrength: 32,
    cursorTracking: true,
  });

  glass.enableLiquidPress();
}

Interactive Docs & Entry Points

The live API documentation and interactive playground cover everything interactively:

  • All 30 LiquidGlassConfig options with live search, sliders, and specimen preview (blur, refractionStrength, magnification, dispersionMode, quality, appearance, respectPreferences, etc.)
  • 6 material presets (clear, thin, regular, thick, ultra, adaptive) and 5 quality tiers (low, medium, high, ultra, extreme)
  • 14 animation & gesture primitives (Spring, SPRING_PRESETS, LiquidInteractive, LiquidSwitch, LiquidMorphModal, LiquidPopover, LiquidContentSwap, LiquidScrollTrack, LiquidTabBar, LiquidGroup, LiquidGesture)
Subpath What's inside
quick-liquid LiquidGlassEngine, presets, springs, gestures, LiquidTabBar, LiquidGroup, and interactive motion controllers
quick-liquid/core Lean LiquidGlassEngine, presets, and config types without animation utilities
quick-liquid/react LiquidGlass, useLiquidGlass, LiquidGlassButton, LiquidSegmented, LiquidToggle, LiquidSwitcher, useLiquidInteractive, useLiquidFlow

Browser Notes & Performance

  • Chromium refraction: Full backdrop-filter: url(...) bending runs in Chromium. Keep glass host elements free of isolation, filter, opacity < 1, and mask.
  • Cross-browser support: Pass opticalSource on <LiquidGlass> to filter React-drawn scenery directly in any browser, or use refractionMode: 'css' (automatic fallback in Safari/Firefox) for frost, tint, and rim lighting.
  • Cache-first pipeline: Displacement maps tabulate a 512-sample 1-D Snell LUT, iterate only the rounded bezel band with 4-way symmetry, and share refcounted maps across matching geometries.

Local Development

npm install
npm test              # run optics & animation tests
npm run typecheck     # type-check packages/quick-liquid
npm run build         # build library, demo, and landingPage
npm run dev:landing   # start the landing + docs + playground site

To regenerate the README showcase PNGs and GIFs from demo/readme-studio.html:

node scripts/render-readme-assets.cjs

Documentation & License

About

Liquid Glass - Heavily Optimised

Topics

Resources

Stars

404 stars

Watchers

2 watching

Forks

Releases

Contributors

Languages