Responsive sizing
Width and height accept pixels or CSS size strings. A ResizeObserver measures the actual layout box and rebuilds an aspect-correct optical map only when the surface size changes.
React component
A source-owned React primitive that bends the live page behind it in Chromium, keeps children sharp, and provides deliberate CSS fallbacks in Safari and Firefox.
Parallax Glass renders tint, blur, specular edges, chromatic separation, and pointer-responsive light around your existing React content. The component never captures the page, clones the DOM, or replaces live content with a rasterized layer. Text and controls behind the surface remain part of the real document.
The implementation is copied into your project, so you can inspect the optical math, tune material presets, and ship without a private runtime package. React 19 is used by this demo, while the installed primitive is ordinary TypeScript and CSS source.
import { LiquidGlass } from "@/components/liquid-glass/liquid-glass"
export function GlassButton() {
return (
<LiquidGlass
width={240}
height={72}
borderRadius={24}
material="control"
>
<button type="button">Open project</button>
</LiquidGlass>
)
}Children render above the optical surface. Use stateLayerfor selection chrome and overlayLayer for an interactive layer that must sit above the content.
Width and height accept pixels or CSS size strings. A ResizeObserver measures the actual layout box and rebuilds an aspect-correct optical map only when the surface size changes.
Choose ultraThin, thin, regular, thick, or ultraThick to increase optical weight, blur, and separation from the background.
Navigation, control, panel, and selectionPressed provide stable starting points for common interface roles.
Tune highlight radius and strength per surface, or disable pointer lighting on non-interactive elements to avoid unnecessary filter work.