Liquid GlassAPI Reference
Liquid GlassAPI Reference
API Overview
All exported symbols in @avenra/liquid-glass.
API Reference
Liquid Glass exports a variety of functions and classes, ranging from high-level component factories to low-level physics and SVG primitives.
| Export | Type | Description |
|---|---|---|
createLiquidGlass | function | Core factory — applies glass effect to any element |
createLiquidButton | function | Animated glass button |
createLiquidSwitch | function | Toggle switch with spring thumb |
createLiquidSlider | function | Horizontal range slider |
createLiquidCursor | function | Glass orb that follows the mouse |
createLiquidInput | function | Glass-wrapped text input |
createLiquidDial | function | Rotary dial / knob |
createLiquidTooltip | function | Glass tooltip that appears above a trigger |
createLiquidProgress | function | Animated progress bar |
init | function | Scan DOM and auto-init all data-liquid-* elements |
Spring | class | Damped spring physics primitive |
PROFILES | object | Built-in surface profile functions |
compute1D | function | Low-level: 1D Snell's law displacement map |
compute2D | function | Low-level: 2D displacement ImageData |
computeSpecular | function | Low-level: specular highlight ImageData |
buildMaps | function | Convenience: run full pipeline, return data URLs |
createFilterSVG | function | Low-level: build SVG filter element |
injectImages | function | Low-level: update displacement/specular images in filter |
setScale | function | Low-level: update feDisplacementMap scale at runtime |
imageDataToURL | function | Convert ImageData to a data: URL |
nextFilterId | function | Generate a unique filter ID string |
supportsBackdropFilter | function | Feature-detect SVG backdrop-filter support |
maxDisp | function | Max absolute value in a 1D map |