useLiquidGlass
The refraction engine behind AppLiquidGlass, AppGlassContainer and AppMagnifier. Builds a lens map for an element, keeps it in step with its size, settings and theme, and says how the current browser can bend what is behind it. Most apps use AppLiquidGlass rather than calling this directly.
Install: pnpm add-composable useLiquidGlass
A custom glass surface
Put the filter on the layer that refracts. When supported is false, nothing bends and the frost alone is shown.
API
target(Ref<HTMLElement | null>): The pane. Its size drives the lens and is observed for changes.params(MaybeRefOrGetter<Partial<LiquidGlassParams>>): radius, bezel, thickness, refractiveIndex, profile, magnification, maxDisplacement, resolution and dispersion. Anything left out takes the default.options.enabled(MaybeRefOrGetter<boolean>): Turn the lens off without unmounting the pane.options.light(MaybeRefOrGetter<GlassLight | null>): Angle and width of the lit rim. Omit or return null to skip painting it.options.source(MaybeRefOrGetter<'auto' | 'backdrop' | 'content'>): What gets bent. auto picks backdrop-filter in Chromium and the marked data-glass-backdrop element elsewhere. In content mode the lenses follow their panes every frame, but only while the marked element is on screen.returns(UseLiquidGlassReturn): filter (the backdrop-filter value), mode ('backdrop' | 'content' | 'none'), rim, map, width, height, supported and refresh().supportsSvgBackdropFilter(() => boolean): Whether the browser runs SVG filters inside backdrop-filter. Only Chromium does.